利用Nexus搭建Maven私服
来源:互联网 发布:日语原版小说软件 编辑:程序博客网 时间:2024/06/03 20:47
私服搭建
Docker Hub链接地址: https://hub.docker.com/r/sonatype/nexus/
docker pull sonatype/nexus
mkdir /data/nexus-data && chown -R 200 /data/nexus-data
docker run -d -p 8081:8081 --name nexus -v /data/nexus-data:/nexus-data sonatype/nexus3
本地Maven配置
修改Maven的全局setting.xml文件如下:
文件路径: $MAVEN_HOME/conf/setting.xml
- mirrors节点加入如下内容
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<name>Nexus</name>
<url>http://192.168.1.80:8081/repository/maven-public/</url>
</mirror>
- profiles节点加入如下内容
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
- activeProfiles节点加入
<activeProfile>nexus</activeProfile>
对于Snapshot的jar,如果想及时的更新,可以在maven参数中加上-U,就可以获得最新的jar包。
本地组件deploy
除了配置本地Maven配置外,还需要在setting.xml文件中加入如下内容:
- servers节点
<server>
<id>maven-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>maven-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
项目的pom.xml文件,加入如下配置:
<distributionManagement>
<repository>
<id>maven-releases</id>
<url>http://192.168.1.80:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<url>http://192.168.1.80:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
0 0
- 利用Nexus搭建Maven私服
- 利用nexus搭建maven私服
- 利用nexus搭建Android的maven私服
- Nexus搭建Maven私服
- Nexus搭建Maven私服
- Nexus搭建Maven私服
- nexus 搭建maven私服
- Maven私服nexus搭建
- 搭建Maven私服 - Nexus
- Nexus搭建Maven私服
- Nexus搭建Maven私服
- Maven 私服nexus搭建
- Nexus搭建Maven私服
- Nexus 搭建Maven 私服
- nexus 搭建 maven 私服
- Nexus搭建Maven私服
- nexus搭建maven私服
- maven搭建nexus私服
- 为什么我们做不到【领导篇】
- Java中ThreadLocal介绍
- vim 的配置
- 349. Intersection of Two Arrays
- 为什么我们做不到【员工篇】
- 利用Nexus搭建Maven私服
- 类(含父类)定义初始化过程
- 课堂笔记--程序设计基础
- bnu52308 We don't wanna work! 【模拟+set】
- Strust2应用开发步骤及注意事项
- <![CDATA[ ]]>
- 不定宽块元素居中
- 第一个SpringMVC
- Hibernate4自学入门(三)——生成策略标识符