When deploying a webapp I need to concat some files, currently this is achieved via an ant task. I'm trying to run this task in the maven build process using something like the following:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<move file="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/log4j.dev.properties"
tofile="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/log4j.properties" />
<move file="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/hibernate.cfg.dev.xml"
tofile="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/hibernate.cfg.xml" />
<delete>
<fileset dir="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/"
includes="**/hibernate.cfg.*.xml" />
<fileset dir="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/"
includes="**/log4j.*.properties" />
</delete>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
The above fails because the files have not yet been copied/deleted into target directory. If I set the phase to "package" the ant task runs fine and all the files are copied/deleted, but it's no help as the .war has already been built before the ant target is run.
Basically, I need to run my ant target near the end of the prepare-package phase.
Having looked though the Lifecycle Reference I can't workout how to expose the more granular Goals to the antrun plugin.
Question: How to achieve this scenario?