(六)maven项目发布

[b]1.配置项目发布到仓库的位置(配置SNAPSHOT和release工厂)[/b]
在超级POM.xml中配置发布管理

<!-- 配置项目发布到私服的哪个仓库中 -->
<distributionManagement>
<!-- 配置SNAPSHOT版本发布的目标仓库 -->
<snapshotRepository>
<id>user-SNAPSHOT</id>
<name>User project release</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
<!-- 配置release版本发布的目标仓库 -->
<repository>
<id>user-release</id>
<name>User project release</name>
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
</repository>

</distributionManagement>


[b]
2.配置Release仓库的发布特性
[/b]
在nexus的管理页面中,打开release版本的发布:
点击release仓库-->Configuration-->Access Settings-->Deployment Policy: AllowRedeploy

[b]
3.配置发布权限
[/b]
用户settings.xml中的server标签进行权限配置,即当发布相应版本的时候,通过指定的用户账号进行发布。(账号使用nexus中默认的deployment账户)

<server>
<!--id必须与pom.xml中的distributionManagement配置的id一致-->
<id>user-SNAPSHOT</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<!--id必须与pom.xml中的distributionManagement配置的id一致-->
<id>user-release</id>
<username>deployment</username>
<password>deployment123</password>
</server>



:arrow: :arrow: :arrow: :arrow: :arrow: :arrow: :arrow: :arrow:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值