我如何将当前的git分支放在一个蚂蚁项目的战舰上

发布于 2025-02-11 10:18:09 字数 152 浏览 1 评论 0原文

我们既有Maven又有蚂蚁项目。

我设法使用org.codehaus.mojo buildnumber-maven-plugin使用maven jar文件执行此操作(不幸的是,同一方法对战争文件无效)。

但是,主要的问题是如何用and.xml中的ant进行此操作

We have both Maven and Ant projects.

I've managed to do this with maven jar files using org.codehaus.mojo buildnumber-maven-plugin (unfortunately the same method doesn't work for war files).

However the main question is how to do this with ant in build.xml

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月下凄凉 2025-02-18 10:18:09

这有效

<target name="war">
<exec executable="git" outputproperty="branch" failonerror="false">
    <arg value="rev-parse"/>
    <arg value="--abbrev-ref"/>
    <arg value="HEAD"/>
</exec>
<manifest>
    <attribute name="Build-Branch" value="${branch}"/>
</manifest>

...

This works

<target name="war">
<exec executable="git" outputproperty="branch" failonerror="false">
    <arg value="rev-parse"/>
    <arg value="--abbrev-ref"/>
    <arg value="HEAD"/>
</exec>
<manifest>
    <attribute name="Build-Branch" value="${branch}"/>
</manifest>

...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文