You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by ertnutler <jm...@hotmail.com> on 2006/09/14 18:16:03 UTC

filtering web.xml with profile properties

I can't for the life of me figure out how to have the maven-war-plugin filter
my web.xml with properties from my profiles.  i've read this thread:

http://www.nabble.com/War-plugin-and-filtering-webapp-files-t1617964.html

and i've tried all the configuration options mentioned there--except
providing the filter files.  this thread seems to provide a solution if i
want to have properties files as my filter source, but i want to have
profiles, so i can take advantage of the inheritance of them to avoid having
to redefine variables multiple times.  this works fine for files in my
webapp that aren't web.xml (i.e., those in src/main/resources).  i was
hoping that the solution to MWAR-41 would provide what i'm looking for, but
it doesn't.

does anybody have web.xml filtering with profile properties working?  if so,
can you post an example?

thanks in advance...
-- 
View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6309369
Sent from the Maven - Users forum at Nabble.com.


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


Re: filtering web.xml with profile properties

Posted by franz see <fr...@gmail.com>.


ertnutler wrote:
> 
> strange.  i got it to work by changing the resource directory from
> ${basedir}/src/main/webapp/WEB-INF to ${basedir}/src/main/webapp.  i can't
> explain why it doesn't work for WEB-INF...
> 

Good day to you, ertnutler,

If it works with a property file, then that's most likely the bug i
mentioned before ([1]).  I made a patch in [1] so that you can use the
properties in your poms without having to specify a property file ^_^ 

Try it if it works ^_^

Regarding the ${basedir}/src/main/webapp only, and
${basedir}/src/main/webapp/WEB-INF dirs, I guess maybe because filtering for
the former is done by maven-resource-plugin, and not by
maven-war-plugin...not sure about this though. 

Cheers,
Franz

[1] http://jira.codehaus.org/browse/MWAR-67
-- 
View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6356093
Sent from the Maven - Users forum at Nabble.com.


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


Re: filtering web.xml with profile properties

Posted by ertnutler <jm...@hotmail.com>.
strange.  i got it to work by changing the resource directory from
${basedir}/src/main/webapp/WEB-INF to ${basedir}/src/main/webapp.  i can't
explain why it doesn't work for WEB-INF...
-- 
View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6325123
Sent from the Maven - Users forum at Nabble.com.


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


Re: filtering web.xml with profile properties

Posted by ertnutler <jm...@hotmail.com>.
it works fine when i use a filter file, but i want to use properties defined
in profiles.  the resources plugin uses them appropriately.  any idea when
the war plugin will do the same?
-- 
View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6324912
Sent from the Maven - Users forum at Nabble.com.


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


Re: filtering web.xml with profile properties

Posted by franz see <fr...@gmail.com>.


ertnutler wrote:
> 
> I can't for the life of me figure out how to have the maven-war-plugin
> filter my web.xml with properties from my profiles.  i've read this
> thread:
> 
> http://www.nabble.com/War-plugin-and-filtering-webapp-files-t1617964.html
> 
> and i've tried all the configuration options mentioned there--except
> providing the filter files.  this thread seems to provide a solution if i
> want to have properties files as my filter source, but i want to have
> profiles, so i can take advantage of the inheritance of them to avoid
> having to redefine variables multiple times.  this works fine for files in
> my webapp that aren't web.xml (i.e., those in src/main/resources).  i was
> hoping that the solution to MWAR-41 would provide what i'm looking for,
> but it doesn't.
> 
> does anybody have web.xml filtering with profile properties working?  if
> so, can you post an example?
> 
> thanks in advance...
> 

Good day to you, ertnutler,

Try creating a property file and have your pom reference that. If the
filtering suddenly works, then what you're experiencing is a bug (see [1]).

Cheers,
Franz

[1] http://jira.codehaus.org/browse/MWAR-67
-- 
View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6317667
Sent from the Maven - Users forum at Nabble.com.


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