We use Hudson, Maven2 and maven-ear-plugin.
Is it possible to have the built EAR files to contain SVN revision in their filename (something like project-1234.ear)?
We use Hudson, Maven2 and maven-ear-plugin.
Is it possible to have the built EAR files to contain SVN revision in their filename (something like project-1234.ear)?
Hudson nows the revision. So you have two options. Just rename the output afterwards or supply Maven with the revision and it can change the name as needed.
Thinkking about it, there might also be another way. Let Maven query svn for the revision and than incorporate it in the earname
However, Do you really need it? Hudson offers the option to fingerprint ears. This way you can submit the file later to Hudson and it gives the the build number back.
You can use the buildnumber-maven-number for this. Basically, this plugin sets a ${buildNumber}
property that you can use later in the maven ear plugin configuration.
First, setup the Build Number Maven Plugin as documented here:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0-beta-4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>true</doCheck>
<doUpdate>true</doUpdate>
</configuration>
</plugin>
...
</plugins>
Then, use the finalName
parameter to customize the name of the generated ear. For example:
<plugins>
...
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.4</version>
<configuration>
<finalName>${project.artifactId}-r${buildNumber}</finalName>
...
</configuration>
</plugin>
...
</plugins>