Problem:
You want to bundle a your application jar files with other software artifacts but as maven names your jar file as magic-app-${project.version}.jar your maven-antrun-plugin fails to pick it up on its own.
Solution:
This was a persistent irritant as every time we upgraded our applications' version we needed to manually enter the same version name to build.properties and only then we can package latest jars for release.
After exploring certain unsatisfactory solution like;
Update your pom as shown below to export maven properties to ant build at run time.
You want to bundle a your application jar files with other software artifacts but as maven names your jar file as magic-app-${project.version}.jar your maven-antrun-plugin fails to pick it up on its own.
Solution:
This was a persistent irritant as every time we upgraded our applications' version we needed to manually enter the same version name to build.properties and only then we can package latest jars for release.
After exploring certain unsatisfactory solution like;
- using-maven-to-output-the-version-number-to-a-text-file
- how-can-i-get-maven-to-write-a-property-into-a-property-file-at-package-time
Update your pom as shown below to export maven properties to ant build at run time.
<plugin>Hope that helps.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<property name="release.version" value="${project.version}" /> <ant antfile="build.xml" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
1 comment:
nice :) . one more irritating manual task removed :)
Post a Comment