[ 
https://jira.codehaus.org/browse/MWAR-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281954#comment-281954
 ] 

Nicolas Marcotte commented on MWAR-9:
-------------------------------------

I have attached a patch named maven-war-plugin-2.1.1-NM that adds the following 
feature to this plugin:
the mutually exclusive (only if set to true) tags:
<regexInPackagingSelectionAllowed>true</regexInPackagingSelectionAllowed>
<negationInPackgingAllowed>true</negationInPackgingAllowed>
that modify the way the values of packagingIncludes and packagingExcludes are 
handled.

The tag regexInPackagingSelectionAllowed can be viewed as replacing 
SelectorUtils.match(pattern,testedString) by 
Pattern.compile(pattern).matcher(testedString).matches() for the interpretation 
of packagingIncludes/Excludes

the tag <negationInPackgingAllowed> permit the usage of the ! operator in the 
packagingIncludes/Excludes. Let me give you an example to illustrate how it 
works;


The jar in WEB-INF/lib before filetering: 
cumulostratus-1.1.jar (declared as optional pulled by stratus)
stratus-1.1.CITRUS.jar (declared as optional but pulled stratus)



{code:xml}
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1-NM</version>
<configuration >                    
  
<negationInPackagingSelectionAllowed>true</negationInPackagingSelectionAllowed>
  <packagingExcludes>**/*.jar,!**/*.CITRUS.jar</packagingExcludes>
</configuration>
{code}

The jar in WEB-INF/lib after filtering: 
stratus-1.1.CITRUS.jar

this patched version is actually running my integration build code, I would 
like feedback upon it

the patch file name is maven-war-plugin-2.1.1-NM.patch 

Please tell me how to proceed to have it reviewed and integrated into your 
trunk if it solved others people needs. 

Ideally that patch would be somewhere in plexus but i only needed it in the war 
with taglibs that must be present in WEB-INF/lib and I am a partisan of the 
minimal impacted dependencies approach to patch outside of major version.  



> WAR plugin should support minimal WARs for inclusion within an EAR
> ------------------------------------------------------------------
>
>                 Key: MWAR-9
>                 URL: https://jira.codehaus.org/browse/MWAR-9
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>            Reporter: Mike Perham
>            Assignee: Stephane Nicoll
>             Fix For: 2.2
>
>         Attachments: AbstractWarMojo.patch, maven-war-plugin-2.1.1-NM.patch
>
>
> I noticed that when I build a WAR, I get a gigantic WEB-INF/lib with all my 
> deps.  This is fine for a default but maven should also support "skeleton" 
> WARs which will be packaged within an EAR.  We have EARs which package 3-4 
> WARs each and to have the deps duplicated within each WAR means we cannot 
> have shared data (since the classes are loaded within each WAR's classloader, 
> rather than by the parent EAR's classloader).  It also means 80MB EARs!  :-)
> It seems like two things need to happen:
> 1) Add a "skeleton" flag which prevents copying any dependencies to 
> WEB-INF/lib.
> 2) Instead generate a META-INF/MANIFEST.MF which has a Class-Path entry which 
> lists the relative locations of the dependencies within the parent EAR.
> Fabrice has basically the same idea written down here.  Starting with "- for 
> a War..." : 
> http://marc.theaimsgroup.com/?l=turbine-maven-user&m=112737860024530&w=2

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to