The container 'Maven Dependencies' references non existing library - STS

121,015

Solution 1

So I get you are using Eclipse with the M2E plugin. Try to update your Maven configuration : In the Project Explorer, right-click on the project, Maven -> Update project.

If the problem still remains, try to clean your project: right-click on your pom.xml, Run as -> Maven build (the second one). Enter "clean package" in the Goals fields. Check the Skip Tests box. Click on the Run button.

Edit: For your new problem, you need to add Spring MVC to your pom.xml. Add something like the following:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>4.0.0.RELEASE</version>
</dependency>

Maybe you have to change the version to match the version of your Spring framework. Take a look here:

http://mvnrepository.com/artifact/org.springframework/spring-webmvc

Solution 2

I got the same problem and this is how i solved. :

  1. Right click your Spring MVC project, choose Run As -> Maven install. Observe the output console to see the installation progress. After the installation is finished, you can continue to the next step.

enter image description here

enter image description here

  1. Right click your Spring MVC project, choose Maven -> Update Project.

enter image description here

  1. Choose your project and click OK. Wait until update process is finished.
  2. The error still yet, then do Project->Clean and then be sure you have selected our project directory and then do the follow Project->Build.

Solution 3

I finally found my maven repo mirror is down. I changed to another one, problem solved.

Solution 4

I'm a little late to the party but I'll give my two cents. I just resolved this issue after spending longer than I'd like on it. The above solutions didn't work for me and here's why:

there was a network issue when maven was downloading the required repositories so I actually didn't have the right jars. adding a -U to a maven clean install went and got them for me. So if the above solutions aren't working try this:

  1. Right click on your project -> Choose Run as -> 5 Maven build...
  2. In the Goals field type "clean install -U" and select Run
  3. After that completes right click on your project again and choose Maven -> Update Project and click ok.

Hope it works for you.

Solution 5

Although it's too late , But here is my experience .

Whenever you get your maven project from a source controller or just copying your project from one machine to another , you need to update the dependencies .

For this Right-click on Project on project explorer -> Maven -> Update Project.

Please consider checking the "Force update of snapshot/releases" checkbox.

If you have not your dependencies in m2/repository then you need internet connection to get from the remote maven repository.

In case you have get from the source controller and you have not any unit test , It's probably your test folder does not include in the source controller in the first place , so you don't have those in the new repository.so you need to create those folders manually.

I have had both these cases .

Share:
121,015
Pablo Fallas
Author by

Pablo Fallas

SOFTWARE | DRUMS | COSTA RICA | 22

Updated on July 09, 2022

Comments

  • Pablo Fallas
    Pablo Fallas almost 2 years

    I'm using win8 previously I had been running Eclipse Juno on my pc but from now on I wanted to start using STS, I am getting the below error as soon as I create a new project. I deleted my .m2 folder and everything related to Eclipse in order to start over from scratch still didn't work, I've ran out of ideas. Any advice???

    Can not find the tag library descriptor for "springframework.org/tags" index.jsp /app/src/main/webapp line 6 JSP Problem

    The container 'Maven Dependencies' references non existing library 'C:\Users\Pablo.m2\repository\org\springframework\spring-webmvc\3.2.3.RELEASE\spring-webmvc-3.2.3.RELEASE.jar' app Build path Build Path Problem

    The project cannot be built until build path errors are resolved app Unknown Java Problem

    ArtifactTransferException: Failure to transfer antlr:antlr:jar:2.7.7 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact antlr:antlr:jar:2.7.7 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 pom.xml /app line 1 Maven Dependency Problem

    22 more errors like this for each of my dependencies...

    Class 'org.springframework.web.servlet.view.InternalResourceViewResolver' not found [config set: app/web-context] mvc-config.xml /app/src/main/webapp/WEB-INF line 16 Spring Beans Problem

  • Pablo Fallas
    Pablo Fallas over 10 years
    Hey Alexis, thanks for the answer I ran a maven install and it seems to be working now but still I'm getting the below error. Can not find the tag library descriptor for "springframework.org/tags"
  • pedrobisp
    pedrobisp over 7 years
    Thanks, this was also my issue.
  • Pereira
    Pereira over 5 years
    Thanks @AlexisDufrenoy There are things in #eclipse that make me nervous. We practically have to use tricks to solve his limitations.
  • riverhorse
    riverhorse almost 5 years
    The "Force update" did the trick for me. In my case I was having two versions of the same library. I had to delete the old version and then in Eclipse Update Maven Project with Force Update...