在idea中使用deploy向远程私服部署jar时,上传到releases和snapshots仓库的原因
使用deploy命令部署jar到远程私服时,发现releases和snapshots两个仓库同时出现了包含snapshot的版本。这是因为:
问题:
- 版本号包括snapshot,应该只上传到snapshots仓库。
答案:
- distributionmangement标签的id相同,导致maven将snapshots仓库的id同时用于release仓库,因此同时上传到两个仓库。
解决办法:
- 为两个仓库配置不同的id,例如:
<distributionManagement> <repository> <id>x-repo-release</id> <url>http://x-repo.abc.net/repository/maven-releases/</url> </repository> <snapshotRepository> <id>x-repo-snapshots</id> <url>http://x-repo.abc.net/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement>
以上是Maven Deploy:为什么SNAPSHOT版本同时上传到releases和snapshots仓库?详情请关注图灵教育的其他相关文章!
