如何配置 Hudson/Maven2 以将 SVN 修订添加到 EAR 名称?
我们使用 Hudson、Maven2 和 maven-ear-plugin。
是否可以让构建的 EAR 文件在其文件名中包含 SVN 修订版(例如 project-1234.ear)?
We use Hudson, Maven2 and maven-ear-plugin.
Is it possible to have the built EAR files to contain SVN revision in their filename (something like project-1234.ear)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 buildnumber-maven-number 来实现此目的。基本上,这个插件设置了一个
${buildNumber}
属性,您可以稍后在 Maven Ear 插件配置中使用该属性。首先,按照此处所述设置 Build Number Maven 插件:
然后,使用
finalName
参数自定义生成的ear的名称。例如:You can use the buildnumber-maven-number for this. Basically, this plugin sets a
${buildNumber}
property that you can use later in the maven ear plugin configuration.First, setup the Build Number Maven Plugin as documented here:
Then, use the
finalName
parameter to customize the name of the generated ear. For example:哈德森现在进行修订。所以你有两个选择。只需稍后重命名输出或向 Maven 提供修订版本,它就可以根据需要更改名称。
想了想,或许还有别的办法。让 Maven 查询 svn 的修订版本并将其合并到earname中
但是,您真的需要它吗? Hudson 提供了对耳朵进行指纹识别的选项。这样您就可以稍后将文件提交给 Hudson,它会返回内部版本号。
Hudson nows the revision. So you have two options. Just rename the output afterwards or supply Maven with the revision and it can change the name as needed.
Thinkking about it, there might also be another way. Let Maven query svn for the revision and than incorporate it in the earname
However, Do you really need it? Hudson offers the option to fingerprint ears. This way you can submit the file later to Hudson and it gives the the build number back.