You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by dddzzz <dz...@gmail.com> on 2008/01/04 17:42:22 UTC

Filtering POMs

Is it possible to filter POMs. Simple case would be:

Filters defined in POM:
<filters>
  <filter>src/main/filters/filter.properties</filter>
</filters>

filter.properties:
# filter.properties
some.version=1.2.3

Using filter values:
<version>${some.version}</version>
-- 
View this message in context: http://www.nabble.com/Filtering-POMs-tp14620305s177p14620305.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: Filtering POMs

Posted by Tomislav Stojcevich <st...@gmail.com>.
The settings.xml will work for properties, however, after re-reading
this, why don't you consider using the war:inplace goal instead, and
have each user setup a context within tomcat's webapp directory using
a context xml file that points back into your project's webapp
directory.  That buys you the ability to make jsp changes without
rebuilding, they'll 'take' while the app is running.

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


Re: Filtering POMs

Posted by Manos Batsis <ma...@geekologue.com>.

To the OP: there is also a maven-properties-plugin that may be useful.

http://arsenalist.com/2007/02/07/maven-properties-plugin-download/

hth,

Manos

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


Re: Filtering POMs

Posted by Tomislav Stojcevich <st...@gmail.com>.
>
> Bad sample case. That can be done with properties. What I would nead now is
> the property that would come from file that is not commited to SVN.  I would
> like to set target dir with that property. So everyone that works with
> project can set target dir pointing to Tomcat webapp dir. If properties
> would be in some .properties file than every developer could set those
> properties only once. The problem is that POMs are soposed to be commited so
> everyone must set its taget dir in POM and be careful not to commit them.
> --

properties can also be set in each user's settings.xml, so create a
property in your pom, you can then optionally give it a default value
in that pom, then have each user over-ride it in their settings.xml
file.

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


Re: Filtering POMs

Posted by dddzzz <dz...@gmail.com>.


dddzzz wrote:
> 
> In hierarchical multi project I need to set parents versions. Every
> project in hierarchy has same version as root project. I would like to set
> it in one place and not in every POM.
> 


Bad sample case. That can be done with properties. What I would nead now is
the property that would come from file that is not commited to SVN.  I would
like to set target dir with that property. So everyone that works with
project can set target dir pointing to Tomcat webapp dir. If properties
would be in some .properties file than every developer could set those
properties only once. The problem is that POMs are soposed to be commited so
everyone must set its taget dir in POM and be careful not to commit them.
-- 
View this message in context: http://www.nabble.com/Filtering-POMs-tp14620305s177p14631267.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: Filtering POMs

Posted by dddzzz <dz...@gmail.com>.


Wayne Fay wrote:
> 
> You can define properties like this in profiles. But realistically,
> you should be using <dependencyManagement> to manage versions, and not
> external filter files.
> 
> Wayne
> 
> 
> 

In hierarchical multi project I need to set parents versions. Every project
in hierarchy has same version as root project. I would like to set it in one
place and not in every POM.
-- 
View this message in context: http://www.nabble.com/Filtering-POMs-tp14620305s177p14625386.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: Filtering POMs

Posted by Wayne Fay <wa...@gmail.com>.
You can define properties like this in profiles. But realistically,
you should be using <dependencyManagement> to manage versions, and not
external filter files.

Wayne

On 1/4/08, dddzzz <dz...@gmail.com> wrote:
>
> Is it possible to filter POMs. Simple case would be:
>
> Filters defined in POM:
> <filters>
>   <filter>src/main/filters/filter.properties</filter>
> </filters>
>
> filter.properties:
> # filter.properties
> some.version=1.2.3
>
> Using filter values:
> <version>${some.version}</version>
> --
> View this message in context:
> http://www.nabble.com/Filtering-POMs-tp14620305s177p14620305.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
>
>

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