Maven install error: Dependency could not be resolved

后端 未结 6 1860
庸人自扰
庸人自扰 2020-11-27 23:33

I am using Maven 3.1.1. When I run mvn install I get the following error:

D:\\spring source>mvn install
[INFO] Scanning for projects...
[INFO         


        
6条回答
  •  情歌与酒
    2020-11-27 23:48

    Where is my Settings.xml?

    Windows users

    It's in your C:/Users//.m2/settings.xml

    Also, this is for specific user. Global one can be present at :

    /conf/settings.xml

    But changing the User one might solve the issue if you can't find the global one.

    Also, equally important, go to Preferences in Eclipse/STS:

    • Goto Maven -> User Settings and verify if both global and user settings.xml files are mentioned in the properties, if not mention them by browsing.

    1. Proxy Issue

    Check Windows Proxy Setting. If there is any proxy which your computer is using then you need to add proxy settings in your settings.xml file too.

    Just add this chunk of code in your settings.xml

    
       
          proxy-id
          true
          http
          ca-something.net
          80
          localhost|10.140.240.90.*
        
       
    

    2. Protocol Issue

    Visit http://repo.maven.apache.org/: If it says Https required.

    Then, you need to add this chunk of code to your settings.xml inside

    
      central-secure
      https://repo.maven.apache.org/maven2
      central
    
    

    Now it should be good to go.

    3. None of the above works

    Try disconnecting any company private VPN and try mvn clean build.

提交回复
热议问题