我们的项目有一个很好的黑客(虽然我猜有更好的方法来做到这一点),以将修订信息嵌入到工件(jar等),当我们使用svn。如何嵌入版本信息使用mercurial和maven(和svn)
现在我们已经迁移到了mercurial,并且我们想要一个类似的东西,但是在我开始使用mercurial进行类似的攻击之前,我想知道是否有更好的方法来做到这一点。
感谢您的回答!
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
<id>svninfo</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>svn</executable>
<arguments>
<argument>info</argument>
<argument>../</argument>
<argument>></argument>
<argument>target/some-project/META-INF/svninfo.txt</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
'hg parent'而不是'hg log -r .'怎么样? – Alex 2014-11-28 17:55:02