【发布时间】:2016-10-28 02:01:34
【问题描述】:
我需要同时构建快照版本和发布版本。
为了构建我喜欢的快照版本
<groupId>com.abc.xyz</groupId>
<artifactId>service</artifactId>
<version>1.0.3-SNAPSHOT</version>
<distributionManagement>
<snapshotRepository>
<id>mvn-git-repo</id>
<uniqueVersion>true</uniqueVersion>
<name>maven git repository</name>
<url>file:/home/mvn-github-repo/snapshot</url>
</snapshotRepository>
</distributionManagement>
要构建发布版本,
<groupId>com.abc.xyz</groupId>
<artifactId>service</artifactId>
<version>1.0.3</version>
<distributionManagement>
<repository>
<id>mvn-git-repo</id>
<uniqueVersion>true</uniqueVersion>
<name>maven git repository</name>
<url>file:/home/mvn-github-repo/release</url>
</repository>
</distributionManagement>
是否可以同时制作两者,以便它一次生成快照版本和发布版本 jar 并部署在各自的存储库中。如果可能的话,我应该在 pom 中保留什么版本?
【问题讨论】:
-
对不起,但这没有意义。您的 lib/app 已发布,因此您构建了一个发布版本,或者您的 lib/app 尚未发布,因此您构建了一个 SNAPSHOT 版本?