You can do it by generating a file with Ant as well. I generate a java
source file with a constant in it in the generate-source phase. You could
generate a .properties file.
This is in the POM under <build><plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>gensrc</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<property name="program.version" value="${parent.version
}"></property>
<ant antfile="build.xml" dir="." target="versionProperties"
inheritRefs="true" />
</tasks>
<sourceRoot>${project.build.directory
}/generated-sources/java</sourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
This is the Ant target:
<target name="versionProperties" description="create the version properties
file">
<echo message="Version = ${program.version}" />
<echo file="${src.dir}/com/mycompany/myapp/ProgramVersion.java">
package com.mycompany.myapp;
/** Generated in ANT */
public class ProgramVersion
{
public static final String VERSION = "${program.version}";
}
</echo>
</target>
-- Lee Meador
On 8/6/07, Nick Stolwijk <[EMAIL PROTECTED]> wrote:
>
> Have a look at the buildnumber plugin, which does exactly that.[1]
>
> Hth,
>
> Nick Stolwijk
>
> [1]
> http://commons.ucalgary.ca/projects/maven-buildnumber-plugin/index.html
>
> DCVer wrote:
> > Hi all,
> >
> > I would like to get the revision number of my project on svn repository
> > using maven2 (or some other tool) and put this number e.g. in some
> property
> > file. How could this be done?
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
-- Lee Meador
Sent from gmail. My real email address is lee AT leemeador.com