maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Gonzalez <adr_gonza...@yahoo.fr>
Subject RE : war plugin: using optional=true
Date Mon, 15 Oct 2007 16:57:50 GMT
Hello,

I'm currently looking at maven source code.

In org.apache.maven.plugin.war.AbstractWarMojo
(v2.0.2), line 582, the .jar is copied in WEB-INF/lib
if !artifact.isOptional().. [1]

I think that optionality is not inherited by
transitivity and that's the cause of my problem :
i.e. if artA declares
     <dependency>
       <artifactId>artB</artifactId>
       <optional>true</optional>
     </dependency>
and artB declares :
     <dependency>
       <artifactId>artC</artifactId>
       <optional>false</optional>
     </dependency>
then artC is transitively included in artA
dependencies  but with optional=false. IMHO it should
be included with optional=true since artB is optional.

Could someone please confirm me ?

[1] ScopeArtifactFilter filter = new
ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
if ( !artifact.isOptional() && filter.include(
artifact ) ) {
   ... 
   //copy action...


--- Adrian Gonzalez <adr_gonzalez@yahoo.fr> a écrit :

> I'm trying to build a ear structure containing war
> and
> jar files.
> 
> I'm using maven-war-plugin instructions from
>
http://maven.apache.org/plugins/maven-war-plugin/examples/war-manifest-guide.html
> (last part of this page) to create MANIFEST.MF.
> 
> Using :
>     <dependency>
>       <groupId>org.foo</groupId>
>       <artifactId>bar-jar1</artifactId>
>       <version>${pom.version}</version>
>       <optional>true</optional>
>       <!-- goes in manifest classpath, but not
> included in WEB-INF/lib -->
>     </dependency>
> 
> works fine for bar-jar1, but if bar-jar1 has
> dependencies, those dependencies are copied to
> WEB-INF/lib.
> I would expect those dependencies to be registered
> in
> the MANIFEST.MF (they are !), but not to be included
> in Web-Inf/lib.
> 
> Is it a bug ? Thanks for the help, I'm really
> struggling with this ear building thing...
> 
> 
> 
>      
>
____________________________________________________________________________________________
> Découvrez le blog Yahoo! Mail : dernières
> nouveautés, astuces, conseils.. et vos réactions !
> http://blog.mail.yahoo.fr
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> For additional commands, e-mail:
> users-help@maven.apache.org
> 
> 



      ____________________________________________________________________________________________
Découvrez le blog Yahoo! Mail : dernières nouveautés, astuces, conseils.. et vos réactions
!
http://blog.mail.yahoo.fr

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


Mime
View raw message