
Alright so now i need to programmatically generate files to include in the WEB-INF directory along other static files.
Round two: Defining multiple places for aggregation
Maven lifecycle is pretty well defined (1). To generate my files, i'm using a Mojo (Maven Pojo) attached to the generate-resources phase. Easy enough, pretty cool.
The issue i have now is that i need to generate those files in target directory. I obviously don't want to put my generated files with the sources and the plugin which builds the war files only allows a unique location for such files... I'm doomed, i need to workaround.
For the workaround (thank you Wesley for the tip) i use:
<project>
...
<build>
...
<resources>
<resource>
<directory>${basedir}/target/generated/</directory>
<targetpath>${basedir}/target/${artifactId}-${version}</targetpath>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
...
</build>
</project>
I'm sure there is a bit better to do (how do i reference the target directory ?) but that's the general idea of the workaround.
In ant i would just use 2 filesets and i would be done.
The advantage that Maven is supposed to give me just vanished and i had to use an ant-style solution. So here i cannot really give a winner, except that Maven failed in its promises (can i have my money back ?), i'll still give 1 point to both.
(1) missing "prepare-package" in the current GA version but included in the coming 2.1. I will need that one, i can trick)





