Reputation: 21186
During my build I generate a build.properties files via the maven properties plugin (properties-maven-plugin) containing build information.
What's the best way to have this file included in the generated jar? I don't want to put it into the src/main/resources directory as this would pollute my default resource directory.
Is there not a "generated-resources" directory as there is with source?
Upvotes: 7
Views: 20047
Reputation: 8160
Place generated sources in target/generated-sources
There is a plugin called build-helper that allows you to add that folder to the source-folders list.
Upvotes: 1
Reputation: 4715
You should put it in the target/classes
directory
(fixed now from just target) and I think that this is better than the accepted one. As there is no need to process this resource as resource anymore
Upvotes: -4
Reputation: 34014
I thought there was a default generated-resources
directory, but I can't find any documentation on that at the moment. You can always configure additional resource directories in your pom:
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-resources</directory>
</resource>
</resources>
...
</build>
Upvotes: 22
Reputation: 47608
you can output your files to any directory and add that resource directory to your <resources>
of your <build>
Upvotes: 0
Reputation: 5327
You can use maven assembly plugin to organize files and filesets in packages. have a look at http://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html I think it is what you need.
Upvotes: 0