Home  >  Q&A  >  body text

java - maven无法下载依赖怎么办

pom.xml 右键 maven install 后,直接就BUILD SUCCESS了,一个依赖都没有下载,可能是maven主库被墙的缘故,然后在maven/conf/setting.xml里配置镜像如下:

<mirrors>
     <mirror>  
      <id>CN</id>  
      <name>OSChina Central</name>                                                                                                                         
      <url>http://maven.oschina.net/content/groups/public/</url>  
      <mirrorOf>central</mirrorOf>
    </mirror>  
</mirrors>
<profiles>
    <profile>
      <id>jdk-1.8</id>
      <activation>
      <jdk>1.8</jdk>
      </activation>
      <repositories>
        <repository>
          <id>nexus</id>
          <name>local private nexus</name>
          <url>http://maven.oschina.net/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>nexus</id>
          <name>local private nexus</name>
          <url>http://maven.oschina.net/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
</profile>

结果还是无法下载依赖,这究竟怎么回事?

PHPzPHPz2714 days ago349

reply all(1)I'll reply

  • 阿神

    阿神2017-04-17 17:55:50

    Isn’t the oschina mirror closed? Go search it?
    http://maven.oschina.net/

    The following are some commonly used maven libraries

    http://repo1.maven.org/maven2/ 
    http://repository.jboss.com/maven2/ 
    http://repository.sonatype.org/content/groups/public/  
    http://mirrors.ibiblio.org/pub/mirrors/maven2/org/acegisecurity/
    
    http://maven.glassfish.org/content/groups/glassfish/
    
    https://nexus.sourcesense.com/nexus/content/repositories/public/
    http://repository.codehaus.org/
    

    reply
    0
  • Cancelreply