1
votes

I have some skinny WARs in EAR. I need to exclude all the war libs except richafeces jars.

I tried this in packagingExcludes

%regex[WEB-INF/lib/(?!richfaces).*.jar]
whitout success.

How to do it?

If I use WEB-INF/lib/*.jar work well, but when use regex something no is not working. I'm using version 2.3 of maven-war-plugin.

2

2 Answers

4
votes

I see this is an old question, so you've probably resolved it one way or another by now. I'm not sure why what you have there wouldn't work. I have a similar situation and this is working for me:

<packagingExcludes>%regex[WEB-INF/lib/(?!servletbridge\.jar).*]</packagingExcludes>

I've also experimented with adding additional filenames to the list, e.g.

<packagingExcludes>%regex[WEB-INF/lib/(?!servletbridge\.jar)(?!secondFile\.jar).*]</packagingExcludes>

This also worked for me without issue. Perhaps a filename typo or unescaped character in your regular expression? (Like the "." in ".jar"? Though technically an unescaped dot shouldn't break the expression, it would just make it less precise since a dot matches any character, including a literal dot.)

0
votes

exclude excludes library from dependency not from the packed libraries