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

后端 未结 7 1905

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.

相关标签:
7条回答
  • 2021-01-30 17:27

    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

    0 讨论(0)
  • 2021-01-30 17:29

    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.

    0 讨论(0)
  • 2021-01-30 17:30

    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.
    0 讨论(0)
  • 2021-01-30 17:36

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

    0 讨论(0)
  • 2021-01-30 17:43

    I have solved it using "force update", pressing Alt+F5 as it is mentioned in the following link.

    0 讨论(0)
  • 2021-01-30 17:45

    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 .

    0 讨论(0)
提交回复
热议问题