Hi Arnaud, Lorenzo!

I'm not sure if the way I solved this problem actually works for you, but maybe 
we can share some ideas.

1. I use a patched maven-war-plugin as described in 
http://jira.codehaus.org/browse/MWAR-73

I use the 'archive-classes' feature to treat the jared class files as attached 
artifact. 
Btw: I should upgrade the patch in MWAR-73 to work with the latest 
maven-war-plugin anyway (if it is still needed)!

      <!-- build the war file -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.0.4-msx.2</version>
        <configuration>
          <archiveClasses>true</archiveClasses>
          <excludes>${warExcludes}</excludes>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>


The attached 'webclasses'-artifact will then be used as dependency in all 
depending war projects.
Additionally I exclude the lib folders

      <!-- build the WAR file using overlaying -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.0.4-msx.2</version>
        <configuration>
          
<dependentWarExcludes>WEB-INF/*.xml,WEB-INF/lib/*.jar</dependentWarExcludes>   
        </configuration>        
      </plugin>   
[*]

We then use
$> mvn war:inplace generate-test-resources
to generate the files in the current working directory.

PRO: 
.) you can debug thru all depending classes via the attached-webclasses.jar
.) you can debug thru all depending JSPs since they got overlayed by the 
war:inplace mojo

CON: 
.) your working directory got polluted with 'waste' from your depending WARs. 
So you have to take care to not checkin JSPs you got from your basis WAR!
.) you have to setup and maintain proper settings in the maven-clean-plugin to 
get rid of all the wast you got from the overlaying.


Hope that I didn't forget something.
It took us (Sigi Goeschl + me) a while to setup this, and it is _not_ very 
beautiful, but at least it works since almost 2 years without big problems.

Would be glad if you guys can share your ideas or point out new ways we may try.

LieGrü,
strub


[*] maybe this has changed since the maven-warplugin-2.0.4, but declaring a WAR 
dependency did not resolve transient dependencies. This is ok if I get them in 
the WEB-INF/lib folder anyway (to prevent us from having them twice), but not 
if we use full maven-dependency management as we do with the attached 
webclasses artifact.

--- Arnaud HERITIER <[EMAIL PROTECTED]> schrieb am Mi, 28.5.2008:

> Von: Arnaud HERITIER <[EMAIL PROTECTED]>
> Betreff: Re: Question about Maven, Eclipse WTP and war overlay
> An: "Maven Users List" <[email protected]>, [EMAIL PROTECTED]
> Datum: Mittwoch, 28. Mai 2008, 10:06
> Nobody ?? I'm also interested by this thread.
> 
> Arnaud
> 
> On Thu, May 22, 2008 at 10:55 PM, Lorenzo Arcaini
> <[EMAIL PROTECTED]>
> wrote:
> 
> > Hello everyone,
> >
> > I have multiple maven projects sharing some code via a
> war overlay and
> > would like to use WTP in Eclipse to deploy my webapps
> and benefit from
> > the productivity gain it brings to the dev teams.
> > However, due to my war overlay, WTP seems unable to
> work properly as
> > my webapps depends on it.
> > My projects have war and ear packaging, but having
> only the war
> > projects working would already be a good thing.
> > Target application server is JOnAS 4.8.6, but then
> again, if it is
> > working with a good old tomcat it should be good
> enough.
> >
> > I think I'm not the only one using war overlay and
> willing to use WTP
> > at the same time, so my question is : how are you
> dealing with this /
> > how should I proceed to make things work ?
> >
> > Regards,
> >
> > Lorenzo Arcaini
> > OCTO Technology - larcaini AT octo DOT com
> > www.octo.com | blog.octo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >


      __________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to