Sorry, I'm not familiar with Axis2, but hopefully someone else on the list
is.  You may want to look into the assembly plugin and see if it'll do what
you want.

Make sure you aren't accidentally using the war:inplace goal for the war
plugin, which would put the overlaid artifacts in the source directory
rather than the target directory and therefore cause your source control
headaches.

- Damon

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

Sorry if I confused you. I can see that your proposed work aroud may
work. But the point of my original email was to bring up some undesired
behavior and to see if I did not configured it correctly.

What I'm doing is to develop an Axis2 service with modules that is
deployed into a JavaEE web container. Not sure if you are familiar with
Axis2, but Axis2 has a war distribution, where I can simply add the AAR
and MAR modules together with the configuration files (such as modified
web.xml, service.list and module.list) to the war distribution and take
the finaly war for deployment. To do that, Axis2 provides a Maven
dependency org.apache.axis2:axis2-webapp for the war distribution. I
constructed a second war with the extra AAR and MAR modules with the new
configuration files and make it dependent on the axis2-webapp. The
documented maven-war-plug overlay behavior seems to do what I would like
it to do, which is to take my war (current project) to populate the
working webapp structure first, then overlay axis2-webapp on top of it
WITHOUT overwriting the existing configuration files (web.xml,
axis2.xml, service.list and module.list) to come up with the final war.
Of course I would also expect that it DOES NOT change my current project
webapp content since I do not need to source-control the axis2-webapp
stuff.

Gang 

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

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]


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