I'm confused.  You should be able to fetch the specific files/directories
that you need from the dependency via the
<includes><include>...</include></includes> element and implicitly exclude
everything else.  If you then need those included files/directories to live
somewhere else in the current war, there are ways to do that.  One
workaround would be to stash the included files in a subdirectory (temp
directory), then use directives during packaging to move the files where you
want them to go in the assembled current war and exclude the temp directory
from the final result.

Can you give an example of what you're trying to do?

- Damon

-----Original Message-----
From: Yang, Gang CTR USA [mailto:[email protected]] 
Sent: Friday, September 18, 2009 9:59 AM
To: Maven Users List
Subject: RE: Maven-war-plugin overlay adds dependent war artifacts to
current project's webapp during build?

As you mentioned, <targetPath> is only used for specifying a target path
relative to the <warSourceDirectory>. If I used it, it would redirect
the dependent war content into a wrong sub directory of the current war.
I really wanted to overlay the two wars, but don't want to change any
one of them.

Also, when there's conflict, the source from the dependent war always
wins, instead of the current war as the document stated.

Gang 

-----Original Message-----
From: Damon Silver [mailto:[email protected]] 
Sent: Friday, September 18, 2009 11:50 AM
To: 'Maven Users List'
Subject: RE: Maven-war-plugin overlay adds dependent war artifacts to
current project's webapp during build?

By default, the overlay lays out its files relative to the root
directory of your war, or whatever <warSourceDirectory> you specify.  If
you want them to be relative to a different location, specify a
<targetPath>.

Theoretically, if you want to exclude various artifacts from the
overlaid war, you could specify them in an
<excludes><exclude>...</exclude><exclude>...</exclude>...</excludes>
block, but I've found this to be broken of late (see
http://jira.codehaus.org/browse/MWAR-198).  I've been using the
<packagingExcludes> element as a workaround during final packaging.

- Damon

-----Original Message-----
From: Yang, Gang CTR USA [mailto:[email protected]]
Sent: Thursday, September 17, 2009 12:32 PM
To: [email protected]
Subject: Maven-war-plugin overlay adds dependent war artifacts to
current project's webapp during build?

Hi,

I'm trying to use the maven-war-plugin to overlay a dependent war on top
of my current war project. The overlay occurred correctly. However,
during the build process, where the overlay occurs, the dependent war's
artifacts are added to my current war project's webapp directory
permanently. This causes source control problem for my current project.
I don't really want to include those dependent war's artifact when
commit the changes for my current war project. Is there a way to change
this behavior? Argueablely, the implementation should have used a temp
directory to do the overlay and keep the current war project's webapp
"as is".

Thanks,
Gang

---------------------------------------------------------------------
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]


---------------------------------------------------------------------
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]

Reply via email to