快照与正式版发布策略
SNAPSHOT 和 RELEASE 使用不同仓库。
仓库配置
XML
<distributionManagement>
<repository>
<id>nexus-releases</id>
<url>https://nexus.company.com/releases</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>https://nexus.company.com/snapshots</url>
</snapshotRepository>
</distributionManagement>
发布区别
| 版本 | 仓库 | 发布次数 |
|---|---|---|
| SNAPSHOT | snapshots | 可多次 |
| RELEASE | releases | 仅一次 |
认证配置
XML
<server>
<id>nexus-releases</id>
<username>deployer</username>
<password>password</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>deployer</username>
<password>password</password>
</server>
要点总结
- repository 正式版仓库
- snapshotRepository 快照版仓库
- SNAPSHOT 可重复发布
- RELEASE 仅能发布一次
- servers 配置认证信息
📝 发现内容有误?点击此处直接编辑