[ https://jira.codehaus.org/browse/MWAR-260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=279052#comment-279052 ]
Joerg Schaible commented on MWAR-260: ------------------------------------- bq. Does it need to declare two dependencies for each overlay, one for the jar and one for the webapp type? Yes. I've recommended it more than once, e.g. here: http://www.mailinglistarchive.com/us...@maven.apache.org/msg58383.html The main problem is IMHO not the declaration of the second artifact, but the proper configuration of the war plugin for each case. # The webapp should have the resulting jar within its WEB-INF/lib and it should not contain anything in WEB-INF/classes. # The assembling webapp must (apart from the declaration of the two dependencies) exclude everything coming from the overlay's WEB-INF/libs, because it calculates its dependencies now on its own. # In a cascading build you have to ensure that you don't inherit unwanted overlays, e.g. webapp A is used as overlay for webapp B which is in turn used as overlay for webapp C. You have to ensure that A is not used directly as overlay again in C, because of the now _visible_ dependency tree. So does your solution address any of this 3 points automatically or do you only spare the declaration of the 2nd artifact? > Patch to provide new war-overlay type > ------------------------------------- > > Key: MWAR-260 > URL: https://jira.codehaus.org/browse/MWAR-260 > Project: Maven 2.x WAR Plugin > Issue Type: Improvement > Components: overlay > Affects Versions: 2.1.1 > Reporter: Alex Clarke > > There are a number of bugs raised around support for WAR overlays: > MWAR-73 - war overlay mechanism does not work for classes > MWAR-253 - Inherit dependencies from a WAR type dependency when it is > overlayed. > MWAR-194 - Warn when inconsistent jar versions are detected during overlay > MWAR-220 - dependencyManagement && overlay + transitive dependency = multiple > versions of same dependency in WEB-INF/lib > MWAR-33 - jars with differents versions can be in WEB-INF/lib with war as > dependencies > Most of these relate to the fact that overlays are not treated as normal > maven dependencies. > The code in https://github.com/SciSysUK/maven-plugins/tree/waroverlay > introduces a new packaging type of "war-overlay", that works in the following > way: > - The primary artifact is a jar containing the classes from the overlay > - Another artifact is attached containing the web content > - A dependency on a war-overlay will automatically pull both artifacts > into the packaged war > To use the new type all you need to do is declare > <extensions>true</extensions> on the maven-war-plugin. There is an > integration test example here: > https://github.com/SciSysUK/maven-plugins/tree/waroverlay/maven-war-plugin/src/it/war-overlay. > > If someone could review the code I could create a patch and update the site > documentation. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira