maven配置阿里云仓库三种方法

一、setting.xml文件配置镜像

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

Xml代码

       <id>mirrorId</id>  

      <mirrorOf>repositoryId</mirrorOf>  

     <name>Human Readable Name for this Mirror.</name>  

      <url>http://my.repository.com/repo/path</url>  
 <mirror>  

       <id>alimaven</id>  

      <mirrorOf>central</mirrorOf>  

     <name>aliyun maven</name>

       <url>http://maven.aliyun.com/nexus/content/groups/public/</url>  

 </mirror>  

二、本地Jar包仓库配置

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

路径自己定义

Xml代码

D:\0soft\repository

三、pom.xml文件仓库配置

Xml代码

    <repository>    

        <id>alimaven</id>    

        <name>aliyun maven</name>    

        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>    

    </repository>  

猜你喜欢

转载自blog.csdn.net/qq_39162487/article/details/119701880