阿里云Maven配置,Maven仓库配置,Maven镜像配置

阿里云Maven配置,Maven仓库配置,Maven镜像配置

========================

蕃薯耀 2018-01-23

http://fanshuyao.iteye.com/

 

一、setting.xml文件配置镜像

找到mirrors镜像节点,增加mirror节点,如下所示:

<mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
	 <mirror>
      <id>alimaven</id>
      <mirrorOf>central</mirrorOf>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </mirror>
  </mirrors>

 

二、本地Jar包仓库配置

在setting.xml文件中找点localRepository节点,具体配置如下:

路径自己定义

  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->
  <localRepository>D:\0soft\repository</localRepository>

 

 

三、pom.xml文件仓库配置

 

<repositories>  
	    <repository>  
	        <id>alimaven</id>  
	        <name>aliyun maven</name>  
	        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
	    </repository>
	</repositories>

 

 

========================

蕃薯耀 2018-01-23

http://fanshuyao.iteye.com/

猜你喜欢

转载自fanshuyao.iteye.com/blog/2408806