How to embed revision information using mercurial and maven (and svn)
- by Zwei Steinen
Our project had a nice hack (although I'm guessing there are better ways to do it) to embed revision information into the artifacts (jar etc.) when we used svn.
Now we have migrated to mercurial, and we want to have a similar thing, but before I start working on a similar hack with mercurial, I wanted to know if there are better ways to do this.
Thanks for your answers!
<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>