maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Lundberg <denn...@apache.org>
Subject Re: Optional dependency not overlaid
Date Sat, 08 Dec 2012 20:35:29 GMT
Hi Daniel,

The 2.0 version of Maven WAR Plugin is over 6 years old. The first thing
I'd do is try a later version to see if it solves your problem. The
latest version is 2.3.

On 2012-12-08 02:32, Winsor, Daniel wrote:
> Hi,
> 
> I have declared an optional dependency, but it is not being overlaid with maven-war-plugin
v 2.0
> 
> //parent-of-everything/pom.xml
> 
> <plugin>
> 
>     <groupId>org.apache.maven.plugins</groupId>
> 
>     <artifactId>maven-war-plugin</artifactId>
> 
>     <configuration>
> 
>         <overlays>
> 
>             <overlay>
> 
>                 <artifactId>to-be-overlaid</artifactId>
> 
>                 <includes>
> 
>                     <include>**</include>
> 
>                 </includes>
> 
>             </overlay>
> 
>             <overlay>
> 
>                 <!-- default self overlay -->
> 
>             </overlay>
> 
>         </overlays>
> 
>     </configuration>
> 
> </plugin>
> 
> 
> 
> //some-webapp-war/pom.xml
> 
>     <dependencies>
> 
>         <dependency>
> 
>             <artifactId>to-be-overlaid</artifactId>
> 
>             <optional>true</optional>
> 
>             <type>war</type>
> 
>         </dependency>
> 
>     </dependencies>
> 
> 
> When optional is set to false, then
> 
> [INFO] Assembling webapp some-webapp-war in /target/some-webapp-war
> 
> [INFO] Expanding: /.m2/repository/to-be-overlaid.war into /target/to-be-overlaid
> 
> [INFO] Overlaying 1 war(s).
> 
> 
> When optional is set to true, then no such overlaying happens.
> 
> However, according to optional dependencies, if some-webapp-war optionally depends on
to-be-overlaid, well it should show up in this first level dependency, just like normal. 
What is going on here?  And how can I best overlay a war to certain other wars while leaving
them out of most wars using parent-of-everything (I am currently using a property in the skip
parameter in maven-war-plugin)?
> 
> Thank you,
> Daniel Winsor
> Associate, IT Architecture
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message