jira-importer commented on issue #189:
URL: 
https://github.com/apache/maven-war-plugin/issues/189#issuecomment-2967849053

   **[Alex 
Rau](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rauar)** 
commented
   
   Good news.
   
   I looks to me as I was able to work around the issue. After a long-day debug 
session in maven I figured out how to enable the inclusion of transitive 
dependencies on WAR dependencies.
   
   I changed 
apache-maven-2.0.9/lib/maven-2.0.9-uber.jar/META-INF/plexus/components.xml 
which obviously configures the plexus container and its components.
   
       <component>
         <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
         <role-hint>war</role-hint>
         
<implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
         <configuration>
           <type>war</type>
           <includesDependencies>false</includesDependencies>
           <language>java</language>
           <addedToClasspath>false</addedToClasspath>
         </configuration>
       </component>
   
   Changing \<includeDependendies/> from true to false for WAR artifacts causes 
Maven to not consider dependencies from WAR artifacts to be already included in 
the WAR artifact itself. Instead they are **properly** resolved including a 
proper dependency resolution. I'll attach an sample overlay project so that 
this is reproducible for others.
   
   Using the following section in the overlay build itself leads to an empty 
WEB-INF/lib for the overlay.
   
   \<build>
   \<plugins>
   \<plugin>
   \<artifactId>maven-war-plugin\</artifactId>
   \<configuration>
   \<dependentWarExcludes>
   WEB-INF/lib/*.jar\</dependentWarExcludes>
   \</configuration>
   \</plugin>
   \</plugins>
   \</build>
   
   This in combination with the above \<includesDependencies/> change means: an 
overlay's WEB-INF/lib is populated with **all** transitive dependencies from 
scratch. Be aware that I only exclude JAR dependencies here for now.
   
   Does that make sense ? Feedback appreciated. Personally I would consider 
this to be the expected default behaviour (compatibility-issues aside) and 
would love to see that behaviour in a newer release (either default behaviour 
or a configuration option somewhere). Right now everyone here has to apply 
these settings manually in their maven installation which is ok for now (but 
not in the long term).
   
   Someone can give feedback on the consequences and side-effects of the above 
change ? Do we break something here in this respect in other places ?
   
   Regards Alex
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to