FWIW, I used a slightly different approach in the cargo uberwar plugin
(which generates a War-of-Wars). I made it look at the WAR
dependencies, and create a 'phantom' pom projects in the repository,
which can then be passed to the "normal" maven dependency
reconciliation framework to work out what JARs ought to end up in
/WEB-INF/lib.

I consider it a totally hacky solution, but avoids having to make your
dependent WAR files 'special' in any way. The root problem is that in
maven 2.0.x, it's really hard to use the dependency resolution stuff
outside the 'default' way (the WAR=no transitive dependencies is burnt
into the WAR metatype, so nothing is considered for resolution beyond
that point). I'm told this is being fixed in 2.1, but I haven't
checked for about 6 months to see if there's any progress.

On Wed, Jun 4, 2008 at 11:07 AM, Arnaud HERITIER <[EMAIL PROTECTED]> wrote:
> Not totally.
> It can fix : Automatically inherit transitive dependencies from the war
> artifact (the default Maven behaviour is not to inherit transitively from
> war dependencies).
> But not : Develop with classes included in the war artifact /WEB-INF/classes
> directory by including them in the project classpath.
>
> Arnaud
>
> On Wed, Jun 4, 2008 at 11:17 AM, Milos Kleint <[EMAIL PROTECTED]> wrote:
>
>> i'm wondering if the solution would render the war-path plugin
>> obsolete? it's causing trouble in embedded use.
>> http://issues.appfuse.org/browse/APF-645
>>
>> Milos
>>
>> On 6/3/08, Arnaud HERITIER <[EMAIL PROTECTED]> 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.html
>> >
>> >  Cheers
>> >
>> >
>> >  arnaud
>> >
>>
>> ---------------------------------------------------------------------
>> 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