You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeffrey Stickel <js...@allegient.com> on 2007/10/09 22:41:31 UTC
Bug, or User Error with maven.war.src.excludes
I have a web project for which I would like to exclude static content in
my resultant war file. I have a property set as follows:
maven.war.src.excludes = **/*.gif
This works great as I need to exclude .gif files from my war. I can
also do this
maven.war.src.excludes = **/*.jpg
This also works when I need to exclude JPGs. Now, according to
http://maven.apache.org/maven-1.x/plugins/war/properties.html, I should
be able to specify both on the same property assignment:
"Comma or space separated list of Ant path patterns specifying what
files and directories from ${maven.war.src} that should be excluded from
the web application.
This tells me that I should be able to do this: (comma-separated)
maven.war.src.excludes = **/*.jpg,**/*.gif
or even this: (space-separated)
maven.war.src.excludes = **/*.jpg **/*.gif
However, neither of these work!! (ugh!!) What happens in each chase is
that NO files get excluded, as if the property was never specified to
begin with.
Can anyone tell me if this is a bug, a feature, or if I'm missing
something completely obvious? All other components of the war are build
perfectly.
Thanks in advance,
Jeff
Re: Bug, or User Error with maven.war.src.excludes
Posted by Nick Stolwijk <ni...@planet.nl>.
I guess you were talking about the maven 1 War plugin?
I've tried to look at the source of the plugin [1] and it uses the
ant:fileset notation:
<ant:fileset dir="${maven.war.src}">
<include name="${maven.war.src.includes}"/>
<exclude name="${maven.war.src.excludes}"/>
<exclude name="${maven.war.expansion.excludes}"/>
</ant:fileset>
When looking at the documentation of the ant:fileset [2] it seems the
war plugin documentation is a straight copy of this. Only nowhere in the
examples given on this page are multiple values comma or space
separated. After more searching I maybe thought it could be the
difference between the fileset excludes attribute and excludes element.
After a google search [3] it seems that is the case. It seems the bug is
between the documentation and the implementation of the war plugin. It
the plugin uses the exclude attribute, it should be ok. Could you maybe
try to check out the plugin, change it and look whether it helps?
Something like this:
<ant:fileset dir="${maven.war.src}" excludes="${maven.war.src.excludes}">
<include name="${maven.war.src.includes}"/>
<exclude name="${maven.war.expansion.excludes}"/>
</ant:fileset>
Hth,
Nick Stolwijk
[1]
http://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk/war/plugin.jelly
[2] http://ant.apache.org/manual/CoreTypes/fileset.html
[3]
http://www.google.nl/search?q=ant+fileset+excludes+attribute+versus+element
Jeffrey Stickel wrote:
> I have a web project for which I would like to exclude static content
> in my resultant war file. I have a property set as follows:
>
> maven.war.src.excludes = **/*.gif
>
>
>
> This works great as I need to exclude .gif files from my war. I can
> also do this
>
> maven.war.src.excludes = **/*.jpg
>
>
>
> This also works when I need to exclude JPGs. Now, according to
> http://maven.apache.org/maven-1.x/plugins/war/properties.html, I
> should be able to specify both on the same property assignment:
>
>
>
> "Comma or space separated list of Ant path patterns specifying what
> files and directories from ${maven.war.src} that should be excluded
> from the web application.
>
>
>
> This tells me that I should be able to do this: (comma-separated)
>
> maven.war.src.excludes = **/*.jpg,**/*.gif
>
>
>
> or even this: (space-separated)
>
> maven.war.src.excludes = **/*.jpg **/*.gif
>
>
>
> However, neither of these work!! (ugh!!) What happens in each chase
> is that NO files get excluded, as if the property was never specified
> to begin with.
>
>
>
> Can anyone tell me if this is a bug, a feature, or if I'm missing
> something completely obvious? All other components of the war are
> build perfectly.
>
>
>
> Thanks in advance,
>
>
>
> Jeff
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org