You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Raffaele <r....@prismasw.it> on 2008/10/24 15:42:12 UTC

War plugin filtering configuration

Hi all,
I'm using quite successfully some special configuration options of war
plugin.
I would like to ask you something:

1) If a filter is applied, is ti possible that that filtering is applied
also to all files contained inside a jar? It seems yes, can you confirm?
2) If inside a file I have a string like ${something} but in my properties
file, it isn't defined that property, after filtering was applied that
string is substituted with an empty string? Or it remains unchanged?

My questions rise because after I've executed a "mvn package" with filtering
applied, I've discovered that one of my jars contained inside the "filtered"
directory has been corrupted.

Thanks in advance and best regards
Raffaele

-- 
View this message in context: http://www.nabble.com/War-plugin-filtering-configuration-tp20150390p20150390.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: War plugin filtering configuration

Posted by Wayne Fay <wa...@gmail.com>.
> 1) If a filter is applied, is ti possible that that filtering is applied
> also to all files contained inside a jar? It seems yes, can you confirm?

For this to work properly, you would need to unpack the jar, filter
the contents, then re-jar it. The filter is not smart enough to unzip
the jar, change the contents, and rejar by itself.

> 2) If inside a file I have a string like ${something} but in my properties
> file, it isn't defined that property, after filtering was applied that
> string is substituted with an empty string? Or it remains unchanged?

It will be substituted with an empty string.

> My questions rise because after I've executed a "mvn package" with filtering
> applied, I've discovered that one of my jars contained inside the "filtered"
> directory has been corrupted.

Filtering simply looks at a file and replaces all instances of ${....}
with the corresponding value. If you have a binary file that has
${....} in it, then that section of the binary file will be replaced
with the corresponding filter value which will probably corrupt your
binary file. This happens frequently with image files -- people
complain about this every couple months on this list.

As a result, you should not include binary files in "filtered" directories.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org