I have a jee-web-application and for using my project with oc4j application server it must be patched in my build-lifecycle to avoid several issues. Actually i do this via maven-antrun-plugin
which works great. I have to remove, copy some special libraries into WEB-INF/lib
and edit the web.xml
, to avoid clashes with EL functions and classloading issues.
According to the maven lifecycle phases i chosed the phase prepare-package
: this phase is executed before the war
file is packaged, but unfortunately also before the (re-)sources are copied into the temporary working dir. I dislike working on the source folders because they're under version control and i don't want to have my coworkers to accidently commit them in cause the build-tool modified them.
So maven copies all the (re-)source stuff to target/__finalName__
where i want to fix the project for the use with oc4j. because this folder is temporary and will be packaged into the war file. Unfortunately the copying and packaging is isolated done in lifecycle package
.
So how can i get between the copying of the sources and resources and the real packaging?
Example with prepare-package
This example doesn't work because the ${project.build.directory}/${build.finalName}
doesn't exists and the ojdbc14.jar wasn't copied there in this phase.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>patch-oc4j</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Patching distribution for OC4J</echo>
<echo>Deleting the obsolete OJDBC library</echo>
<delete file="${project.build.directory}/${build.finalName}
/WEB-INF/lib/ojdbc14.jar" />
[... more patching ...]
</tasks>
</configuration>
</execution>
</executions>
</plugin>