mave使用私有仓库

来源:互联网 发布:凸包算法 matlab 编辑:程序博客网 时间:2024/06/15 14:59

一、安装使用nexus

1、下载nexus,进行解压

2、将bin的目录配置到环境变量path中

3、使用cmd进行install

二、maven中使用nexus

1、在settings.xml配置如下

 <mirror>            <id>nexus</id>            <name>internal nexus repository</name>            <url>http://127.0.0.1:8081/nexus/content/groups/public/</url>            <mirrorOf>central</mirrorOf>        </mirror> 

2、在settings.xml配置Repository的权限

    <server>      <id>my-snapshots</id>      <username>admin</username>      <password>admin123</password>    </server>

3、在项目的pom.xml中配置如下

   <distributionManagement>        <snapshotRepository>            <id>my-snapshots</id>            <name>nexus distribution snapshot repository</name>            <url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url>        </snapshotRepository>    </distributionManagement>
注意:其中的id:my-snapshots一定要在2中配置

0 0