How to embed revision information using mercurial and maven (and svn)

Posted by Zwei Steinen on Stack Overflow See other posts from Stack Overflow or by Zwei Steinen
Published on 2010-06-06T13:25:13Z Indexed on 2010/06/06 13:32 UTC
Read the original article Hit count: 213

Filed under:
|
|
|
|

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>

© Stack Overflow or respective owner

Related posts about java

Related posts about svn