maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Höller <>
Subject Re: Tip about Skinny Wars
Date Tue, 01 Jul 2008 12:58:41 GMT
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

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 :
> Cheers
> arnaud

View raw message