Maven not downloading dependencies in Eclipse

后端 未结 11 1440
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 19:08

I am setting up a project in eclipse . This projects builds successfully through command line(all mvn commands like mvn package, mvn compile<

相关标签:
11条回答
  • 2021-01-03 19:47
    1. Try to move your dependencies from "type" tag to "scope" tag like below

    or

    <dependency>
            <groupId>net.xyz.xyz</groupId>
            <artifactId>xyz-xyz</artifactId>
            <version>x.y.z</version>
            <type>pom</type>
     </dependency>
    

    or

    <dependency>
                <groupId>net.xyz.xyz</groupId>
                <artifactId>xyz-xyz</artifactId>
                <version>x.y.z</version>
                <scope>test</scope> 
         </dependency>
    

    then further Maven > Update Project

    0 讨论(0)
  • 2021-01-03 19:48

    Solution 1:

    Set correct proxy:

    <proxy>
        <id>optional</id>
        <active>false</active>
        <protocol>http</protocol>
        <username></username>
        <password></password>
        <host>172.27.171.91</host>
        <port>8080</port>
    </proxy>
    

    Solution2 :

    just delete

    lastupdated extension files from folder
    

    and try updating maven.

    [Most of the times this solution will work]

    0 讨论(0)
  • 2021-01-03 19:50

    For me I changed the packaging from pom to jar, and then the dependency got downloaded.

    so I changed from <packaging>pom</packaging> to <packaging>jar</packaging>
    
    0 讨论(0)
  • 2021-01-03 19:53

    I have come across the same issue recently.

    First of all you have to configure proxy settings in settings.xml in your maven repository.

    If you are using eclipse/STS then please do verify following.

    Window -> Preferences -> Maven -> User Settings -> update user settings by pointing your settings.xml
    

    Now it's set to update the maven project. It worked for me.

    0 讨论(0)
  • 2021-01-03 19:59

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

    1. Right click your 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)
提交回复
热议问题