简体   繁体   English

Maven-pom版本为快照时生成最新版本的jar

[英]Maven - Generate latest release jar when pom version is snapshot

Latest release of my app is 2.0. 我的应用程序的最新版本是2.0。

In my pom.xml I have 2.1-SNAPSHOT as version 在我的pom.xml中,我有2.1-SNAPSHOT版本

I want to generate my-app-2.0.jar (not my-app-2.1-SNAPSHOT.jar) in /target 我想在/ target中生成my-app-2.0.jar(不是my-app-2.1-SNAPSHOT.jar)

Simple as that, anyone knows? 就这么简单,有人知道吗? Thanks! 谢谢!

To get the exact source code of the released component, you should checkout the tag of this version of the component on your SCM (source control management) that ideally should be a unmodifiable directory to reflect exactly the source code of the released component. 要获取已发布组件的确切源代码,您应该在SCM(源代码管理)上tag出该版本组件的tag ,理想情况下,该tag应该是不可修改的目录,以准确反映已发布组件的源代码。
This is not always the case. 这并非总是如此。
So, you could check this point and the history of the tag folder to ensure of it. 因此,您可以检查这一点以及标记文件夹的历史记录以确保这一点。

Then rebuild the checked-out project with the mvn clean package command. 然后,使用mvn clean package命令重建检出的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM