maven 设置中央仓库


  1. 安装目录下修改 setting.xml
<mirror>  
  <id>alimaven</id>  
  <name>aliyun maven</name>  
  <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
  <mirrorOf>central</mirrorOf>          
</mirror>
2. 每个 maven 项目可以单独配置仓库地址 alirep aliyun maven http://maven.aliyun.com/nexus/content/groups/public/
<pluginRepositories>
	<pluginRepository>
	  <id>alirep</id>
      <name>Central Repository</name>
	  <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </pluginRepository>
</pluginRepositories>
  1. 可以利用插件查看仓库配置是否生效
org.apache.maven.plugins maven-antrun-plugin 1.1 id.clean clean run 本地仓库地址:${settings.localRepository} 中央仓库地址:${project.repositories[0].url} 插件仓库地址:${project.pluginRepositories[0].url} ``` ![](https://img2018.cnblogs.com/blog/1490151/202002/1490151-20200228153836523-237036097.png)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM