My workaround is more a hack that something else.
It's not really logical to have in a project to dependencies to a pom and a
war of a same artifact.
This is certainly a bug in the core of maven which doesn't support it :-(
I'm trying to see how I can change the ear plugin to fix this issue.

Arnaud

On Tue, Jul 1, 2008 at 2:58 PM, Martin Höller <[EMAIL PROTECTED]> wrote:

> Hi Arnaud!
>
> I think I found one BIG problem with your workaround: it only works if you
> already have (the latest version of) your WAR's pom.xml file in the
> repository, otherwise maven 2.0.9 reports a missing dependency.
>
> So this approach is not useable with the maven-release-plugin :-(
>
> I made up a simple test project consisting of a parent and three modules:
> myJar, myWar, and myEar. myEar depends on myWar and myWar depends on myJar.
> With your approach and an empty repository the build fails due to a missing
> myWar:pom dependency.
>
> As I think this list doesn't allow attachments I've made the sample
> available at 
> http://www.xss.co.at/~martin/tmp/m2-skinny-war-demo.tar.bz2<http://www.xss.co.at/%7Emartin/tmp/m2-skinny-war-demo.tar.bz2>
>
> A 'mvn package' fails, while a 'mvn install' succeeds.
>
> Any comments?
>
> - martin
>
> On Tuesday 03 June 2008 Arnaud HERITIER wrote:
> > Hi all,
> >
> >   I would like to share with you a workaround I found for the problem of
> > transitive dependencies in skinny wars.
> >   In the documentation it is said that :
> >  "Now the painful part.  Your EAR's <<<pom.xml>>> needs to list every
> > dependency that the WAR has.
> >  This is because Maven assumes fat WARs and does not include transitive
> > dependencies
> >  of WARs within the EAR."
> >
> >   A workaround of this is to define for each war 2 dependencies. One for
> > the war itself and another for the war's pom to retrieve transitive
> > dependencies.
> >   With that you'll have something like that in your ear dependencies :
> >
> >     <dependencies>
> >         <dependency>
> >             <groupId>com.acme</groupId>
> >             <artifactId>war1</artifactId>
> >             <version>1.0.0</version>
> >             <type>war</type>
> >         </dependency>
> >         <dependency>
> >             <groupId>com.acme</groupId>
> >             <artifactId>war1</artifactId>
> >             <version>1.0.0</version>
> >             <type>pom</type>
> >         </dependency>
> >     </dependencies>
> >
> > I'm using maven 2.0.9.
> >
> > I'll do more tests tomorrow and I'll update the doc :
> >
> http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.htm
> >l
> >
> > Cheers
> >
> > arnaud
>
>
>

Reply via email to