Inside your configuration for maven-war-plugin, I would do something like
this (this is untested but approximate):
...
<overlays>
<overlay>
<id>someOverlay</id>
<groupId>foo.bar</groupId>
<artifactId>baz.bax</artifactId>
<type>war</type>
<includes>
<include>path/to/directory/**</include>
</includes>
<targetPath>somewhere/out/of/the/way</targetPath>
</overlay>
<overlay>
<!--
Empty groupId/artifactId detected as the current build.
someOverlay overlays must come before this for
<webResources>
block below to work properly!
-->
</overlay>
</overlays>
<webResources>
<resource>
<directory>${project.build.directory}/war/work/yourProjectsGroupId/somewhere
/out/of/the/way</directory>
<targetPath>new/directory</targetPath>
<includes>
<include>fileToOverwriteWith1</include>
<include>fileToOverwriteWith2</include>
<include>fileToOverwriteWith3</include>
</include>
</resource>
</webResources>
...
- Damon
-----Original Message-----
From: Conan Cook [mailto:[email protected]]
Sent: Tuesday, November 10, 2009 7:46 AM
To: '[email protected]'
Subject: maven-war-plugin overlay ordering
Dear Maven Folk,
This is a query that's been asked before relating to the maven-war-plugin,
but I've done some digging and I can't find an answer, so I'd be very
grateful if anyone can point me in the right direction.
I've got a project A which depends on a war B and so I'm using an overlay.
I need to replace some of the files in B with modified versions that live in
A. The maven-war-plugin versions 2.0 and 2.0.1 do this fine, but versions
after that don't - they overwrite the files I've got in the parent project A
with ones from B, but I never want that to happen.
I've tried re-ordering the overlay using the <overlays> element, and
specifying an empty <overlay> to identify the current project. I've tried
this with versions 2.1-alpha-1, 2.1-alpha-2 and 2.1-beta-1, and there is no
order I can specify the overlays in any of them to ensure that files from
the dependency do not overwrite the files in my project. I've seen issues
that refer to this, and which say the issue is resolved (e.g.
http://jira.codehaus.org/browse/MWAR-47,
http://jira.codehaus.org/browse/MWAR-66) but I cannot find a way to achieve
the desired behaviour in any version of the plugin after 2.0.1. There is a
currently open Major issue (http://jira.codehaus.org/browse/MWAR-149) which
describes the problem I have, but it was raised 20 months ago and nobody has
commented on it, suggesting that development effort has moved elsewhere.
Does anybody know of a way to achieve this using version 2.1-x of the
maven-war-plugin?
Thanks very much,
Conan Cook
Senior Applications Developer
Academic Technologies Group (ATG)
University of the West of England
Frenchay Campus
Bristol BS16 1QY
This email was independently scanned for viruses by McAfee anti-virus
software and none were found
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]