You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Les Hazlewood <le...@hazlewood.com> on 2009/01/30 22:28:09 UTC

Web module: three .war files

Hi all,

I would like to know the "Maven Way" to accomplish the following:

I have a web module that is currently being built with ant but want it to be
built by Maven.  Based on a build property, one of three wars can be built.
The _only_ difference between these three .wars (when they're finished being
built) is that the web.xml file has a single Servlet context-param that has
a different value between the 3.

That is, we have a template.web.xml file with the following:
...
<context-param>
    <param-name>someParamName</param-name>
    <param-value>@valueToBeSubstitutedAtBuildTime@</param-value>
</context-param>
...

Then in Ant, for each war that is created, a different value is copied into
the template by substitution in Ant's copy task.

How can I cleanly achieve this the Maven Way?  I don't mind if I have to
define 3 different web modules, but I want to ensure that I only have a
single web.xml template file in the project source tree to ensure any other
changes in it are reflected across all three generated .wars.

Any information or pointer to an existing solution is much appreciated.

Thanks!

Les

Re: Web module: three .war files

Posted by Wayne Fay <wa...@gmail.com>.
> Then in Ant, for each war that is created, a different value is copied into
> the template by substitution in Ant's copy task.

This kind of thing is exactly what Maven's profiles and filters are used for.

Wayne

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