[英]Release maven project removing automatically SNAPSHOT dependencies
I want to make my first release of a multi-module maven project using the maven release plugin. 我想使用maven版本插件来发布多模块maven项目的第一个版本。 I´m facing a problem in the release:prepare step because I have SNAPSHOT dependencies. 我在release:prepare步骤中遇到问题,因为我具有SNAPSHOT依赖项。
<project ...>
<parent>
<artifactId>project</artifactId>
<groupId>ccc.aaa.bbb</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>common</artifactId>
<packaging>pom</packaging>
<name>common</name>
<modules>
<module>daoModule</module>
<module>configModule</module>
<module>exceptionModule</module>
</modules>
<scm>
...
</scm>
<distributionManagement>
<repository>...</repository>
<snapshotRepository>...</snapshotRepository>
</distributionManagement>
</project>
And the modules extend this as its parent: 模块将其扩展为其父级:
<project ...>
<parent>
<artifactId>common</artifactId>
<groupId>ccc.aaa.bbb</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>exceptionModule</artifactId>
<name>exceptionModule</name>
<build>
...
The plugin changes the the version of the artifact 0.0.1-SNAPSHOT to a release version 0.0.1 , and creates the new snapshot version id 0.0.2-SNAPSHOT. 该插件将工件0.0.1-SNAPSHOT的版本更改为发行版0.0.1,并创建了新的快照版本ID 0.0.2-SNAPSHOT。
¿Is there any way to change automatically the version of the parents from 0.0.1-SNAPSHOT to 0.0.1 - the release that is going to be created-? 有什么方法可以自动将父版本从0.0.1-SNAPSHOT更改为要创建的版本0.0.1?
Thanks. 谢谢。
It should work when doing release:prepare
from the aggregator project level that contains all the modules you're interested in. So your common
, project
artifacts and all the modules should be released at once. 它在release:prepare
时应该可以工作release:prepare
从包含您感兴趣的所有模块的聚合器项目级别进行release:prepare
。因此,您的common
project
工件和所有模块应立即发布。 Also look at autoVersionSubmodules
switch to do a little less typing. 还要看一下autoVersionSubmodules
开关,以减少打字。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.