views:

183

answers:

1

Hi all,

I have developed a maven plugin that downloads the release notes from JIRA. It's bound by default to the 'generate-sources' phase and creates a 'release.txt' file in the build folder (${project.build.directory}).

My question: how can I add this file in the 'WEB-INF' folder of the war file built by Maven ?

I know I can use the 'maven-war-plugin' to include additional external resources from the 'src' folder, but I don't want my 'release.txt' file generated there (=not commitable to svn).

Thanks for your help. I wish you a nice day!

Maxence

A: 

Hi there

I think this can be done using this feature of that plugin:

Adding and Filtering External Web Resources: http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html

Which would allow you to generate your release.txt into a separate folder (not src) and have the plugin treat it as an extra resources folder.

Hope that helps.

simonlord
Ok like this it works:<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId><version>2.1-alpha-2</version><configuration><webResources><resource><directory>${project.build.directory}</directory><targetPath>WEB-INF</targetPath><includes><include>release.txt</include></includes></resource></webResources></configuration></plugin>Remark: the targetPath setting is ignored with version 2.0
Optimus Prime