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

Nicolas Marcotte edited comment on MWAR-81 at 10/24/11 9:44 PM:
----------------------------------------------------------------

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 (pulled stratus as it is a dependancies)



{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.  



      was (Author: nicolasm):
    
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.  


  
> Request enhancement to pattern matching for 
> warSourceIncludes/warSourceExcludes functionality (regular expressions?)
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: MWAR-81
>                 URL: https://jira.codehaus.org/browse/MWAR-81
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Wish
>         Environment: n/a
>            Reporter: Bryan Loofbourrow
>            Priority: Minor
>         Attachments: maven-war-plugin-2.1.1-NM.patch
>
>
> The Maven War Plugin currently permits choosing what files will wind up in 
> the .war. It does this via two parameters, warSourceIncludes, and 
> warSourceExcludes.  The rule appears to be that the includes are computed, 
> and a list of matches made, then that list is run against the excludes, and 
> any matches taken out of the include list.
> The only wildcards that appear to be supported are *, **, and ?.
> That doesn't work well if you are packaging wars in ears, and therefore want 
> to exclude all jars from the war, except for one or two that have to be in 
> the war in order to run properly.  "Exclude all but foo.jar and bar.jar" just 
> doesn't translate well to "here's your simple include template, here's your 
> simple exclude template" representation, at least with current wildcards.
> So this is a wish specifically for something to address the "exclude all but 
> x, y, and z" need for war source includes/excludes, and a suggestion that it 
> might be best to deprecate the warSourceIncludes/warSourceExcludes approach 
> in favor of a single parameter that supports regular expressions instead.

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

        

Reply via email to