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)
posted @ 2020-02-28 15:39  别再闹了  阅读(2989)  评论(0)    收藏  举报