Maven仓库设置

有时可能会连不上Maven的黙认中央库,那我们可以尝试去修改这个黙认的中央库

中央库地址:
1. https://repo.maven.apache.org/maven2  (黙认地址,黙认存放在${maven_home}\lib\maven-model-builder-3.3.9.jar中的org\apache\maven\model\pom.xml文件中)
2. http://www.sonatype.org/nexus/
3. http://mvnrepository.com/


在pom.xml文件中加入以下内容:

  <repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

猜你喜欢

转载自wen19851025.iteye.com/blog/2311708