elharo commented on issue #505:
URL: 
https://github.com/apache/maven-war-plugin/issues/505#issuecomment-5142701519

   This is user error caused by an incorrect regular expression.
   
   In the user's configuration:
   
`<packagingExcludes>%regex[WEB-INF/lib/[email\\-library\\-|web\\-services\\-library\\-].*\\.jar]</packagingExcludes>`
   
   The user enclosed their alternation (`|`) inside square brackets `[...]`. In 
regular expressions, square brackets define a character class, which matches 
any single character present in the set. Therefore, 
`[email\-library\-|web\-services\-library\-]` will only match exactly one 
character from that set (such as 'e', 'm', 'a', '-', '|', 'w', etc.), rather 
than evaluating the logical OR between the two full strings "email-library-" 
and "web-services-library-".
   
   To apply an alternation to multi-character strings, the user must use 
parentheses `()` for grouping. The correct syntax is:
   
`<packagingExcludes>%regex[WEB-INF/lib/(email\-library\-|web\-services\-library\-).*\.jar]</packagingExcludes>`
   
   A commenter on the issue (Cedric HENRY) correctly identified this syntax 
error. The plugin itself is functioning as designed.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to