You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by William wang <su...@gmail.com> on 2006/02/10 07:36:00 UTC

how to defined pom.xml scope variable?

hi:
in ant build.xml we can define a variable refer in furture like this:

<property name="JBoss.home" value="C:/jboss-3.2.3"/>

refer like this:

<property name="JBoss.3.x+.Client.home" value="${JBoss.home}/client"/>

but in maven 2.x pom.xml ,how to define a similar pom variable refer in
furture?


thanks.

Re: how to defined pom.xml scope variable?

Posted by William wang <su...@gmail.com>.
Damian :
thanks


On 2/10/06, Damian Krzeminski <da...@pingtel.com> wrote:
>
> William wang wrote:
> > hi:
> > in ant build.xml we can define a variable refer in furture like this:
> >
> > <property name="JBoss.home" value="C:/jboss-3.2.3"/>
> >
> > refer like this:
> >
> > <property name="JBoss.3.x+.Client.home" value="${JBoss.home}/client"/>
> >
> > but in maven 2.x pom.xml ,how to define a similar pom variable refer in
> > furture?
> >
> >
> > thanks.
> >
>
> You could add something like that to your pom.xml
>
>    <properties>
>      <jboss.home>/path/to/jboss</jboss.home>
>      <jboss.client.home>${jboss.home}/client</jboss.client.home>
>    </properties>
>
> Absolute pathnames in the pom are probably not the best idea. You can pass
> the initial value from
> command line:
>
>     mvn -Djboss.home=/my/path/to/jboss
>
> or from environment variable, just add prefix "env.":
>
>      <jboss.client.home>${env.JBOSS_HOME}/client</jboss.client.home>
>
>
> D.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: how to defined pom.xml scope variable?

Posted by Damian Krzeminski <da...@pingtel.com>.
William wang wrote:
> hi:
> in ant build.xml we can define a variable refer in furture like this:
> 
> <property name="JBoss.home" value="C:/jboss-3.2.3"/>
> 
> refer like this:
> 
> <property name="JBoss.3.x+.Client.home" value="${JBoss.home}/client"/>
> 
> but in maven 2.x pom.xml ,how to define a similar pom variable refer in
> furture?
> 
> 
> thanks.
> 

You could add something like that to your pom.xml

   <properties>
     <jboss.home>/path/to/jboss</jboss.home>
     <jboss.client.home>${jboss.home}/client</jboss.client.home>
   </properties>

Absolute pathnames in the pom are probably not the best idea. You can pass the initial value from 
command line:

    mvn -Djboss.home=/my/path/to/jboss

or from environment variable, just add prefix "env.":

     <jboss.client.home>${env.JBOSS_HOME}/client</jboss.client.home>


D.


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