You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by amys <am...@gmail.com> on 2009/04/02 12:46:02 UTC

Maven2 ignoring environment variables

I use an environment variable like ${env.FLORENCE_HOME} in my pom.xml files.
Sometimes this resolves correctly, sometimes it doesn't, and then Maven
generates files into a directory literally called  ${env.FLORENCE_HOME} in
my build environment.

Specifically, I define a variable ${florence.server} based on
${env.FLORENCE_HOME}  in one pom.xml, then reference ${florence.server}  in
another pom.xml. 

This generally works, and I cannot tell what triggers the problem, Moreover,
even where the bug occurs, the base pom is being correctly referenced, as
the variable ${florence.server} does resolve, even when the env variable it
references does not.

Using 
- Maven 2.1
- Eclipse Maven Plugin 0.9.7 of 20081130
-- 
View this message in context: http://www.nabble.com/Maven2-ignoring-environment-variables-tp22845174p22845174.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: Maven2 ignoring environment variables

Posted by "D. Kautz" <Do...@nielsen.com>.
I found a "work around" on my own.  Actually in retrospect I realize that
this is the Maven way to do this.  The solution is to set up profiles in
your POM that create the required system variables.  Then just invoke the
profile with the -Pprofile_id argument to Maven.



We have experience the same thing.  We are using arguments to categorize our
unit tests.  This has stopped working when we upgraded to 2.2.0.

Anyone have a workaround?


Hmmm, we noticed that passing any args like

     mvn -Dblah=didah

works fine up to 2.0.9, but is broken thereafter.  Anyone ran into the same
issue?

-- 
   =NPG=


-- 
View this message in context: http://www.nabble.com/Maven2-ignoring-environment-variables-tp22845174p24591876.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: Maven2 ignoring environment variables

Posted by "D. Kautz" <Do...@nielsen.com>.
We have experience the same thing.  We are using arguments to categorize our
unit tests.  This has stopped working when we upgraded to 2.2.0.

Anyone have a workaround?


Guba, Nicolai wrote:
> 
> Hmmm, we noticed that passing any args like
> 
>      mvn -Dblah=didah
> 
> works fine up to 2.0.9, but is broken thereafter.  Anyone ran into the
> same issue?
> 
> -- 
>    =NPG=
> 
>> -----Original Message-----
>> From: Brian E. Fox [mailto:brianf@reply.infinity.nu]
>> Sent: Thursday, April 02, 2009 12:39 PM
>> To: Maven Users List
>> Subject: Re: Maven2 ignoring environment variables
>> 
>> In general, try to avoid using env vars as it makes your build more
>> fragile
>> as you¹ve noticed. Somehow it seems these env aren¹t getting through to
>> maven, but there¹s not enough info below to tell you why.
>> 
>> 
>> On 4/2/09 6:46 AM, "amys" <am...@gmail.com> wrote:
>> 
>> >
>> >
>> > I use an environment variable like ${env.FLORENCE_HOME} in my pom.xml
>> files.
>> > Sometimes this resolves correctly, sometimes it doesn't, and then Maven
>> > generates files into a directory literally called  ${env.FLORENCE_HOME}
>> in
>> > my build environment.
>> >
>> > Specifically, I define a variable ${florence.server} based on
>> > ${env.FLORENCE_HOME}  in one pom.xml, then reference ${florence.server}
>> in
>> > another pom.xml.
>> >
>> > This generally works, and I cannot tell what triggers the problem,
>> Moreover,
>> > even where the bug occurs, the base pom is being correctly referenced,
>> as
>> > the variable ${florence.server} does resolve, even when the env
>> variable
>> it
>> > references does not.
>> >
>> > Using
>> > - Maven 2.1
>> > - Eclipse Maven Plugin 0.9.7 of 20081130
>> > --
>> > View this message in context:
>> > http://www.nabble.com/Maven2-ignoring-environment-variables-
>> tp22845174p2284517
>> > 4.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven2-ignoring-environment-variables-tp22845174p24587798.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: Maven2 ignoring environment variables

Posted by "Guba, Nicolai" <ng...@bioware.com>.
Hmmm, we noticed that passing any args like

     mvn -Dblah=didah

works fine up to 2.0.9, but is broken thereafter.  Anyone ran into the same issue?

-- 
   =NPG=

> -----Original Message-----
> From: Brian E. Fox [mailto:brianf@reply.infinity.nu]
> Sent: Thursday, April 02, 2009 12:39 PM
> To: Maven Users List
> Subject: Re: Maven2 ignoring environment variables
> 
> In general, try to avoid using env vars as it makes your build more
> fragile
> as you¹ve noticed. Somehow it seems these env aren¹t getting through to
> maven, but there¹s not enough info below to tell you why.
> 
> 
> On 4/2/09 6:46 AM, "amys" <am...@gmail.com> wrote:
> 
> >
> >
> > I use an environment variable like ${env.FLORENCE_HOME} in my pom.xml
> files.
> > Sometimes this resolves correctly, sometimes it doesn't, and then Maven
> > generates files into a directory literally called  ${env.FLORENCE_HOME}
> in
> > my build environment.
> >
> > Specifically, I define a variable ${florence.server} based on
> > ${env.FLORENCE_HOME}  in one pom.xml, then reference ${florence.server}
> in
> > another pom.xml.
> >
> > This generally works, and I cannot tell what triggers the problem,
> Moreover,
> > even where the bug occurs, the base pom is being correctly referenced,
> as
> > the variable ${florence.server} does resolve, even when the env variable
> it
> > references does not.
> >
> > Using
> > - Maven 2.1
> > - Eclipse Maven Plugin 0.9.7 of 20081130
> > --
> > View this message in context:
> > http://www.nabble.com/Maven2-ignoring-environment-variables-
> tp22845174p2284517
> > 4.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


Re: Maven2 ignoring environment variables

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
In general, try to avoid using env vars as it makes your build more fragile
as you¹ve noticed. Somehow it seems these env aren¹t getting through to
maven, but there¹s not enough info below to tell you why.


On 4/2/09 6:46 AM, "amys" <am...@gmail.com> wrote:

> 
> 
> I use an environment variable like ${env.FLORENCE_HOME} in my pom.xml files.
> Sometimes this resolves correctly, sometimes it doesn't, and then Maven
> generates files into a directory literally called  ${env.FLORENCE_HOME} in
> my build environment.
> 
> Specifically, I define a variable ${florence.server} based on
> ${env.FLORENCE_HOME}  in one pom.xml, then reference ${florence.server}  in
> another pom.xml.
> 
> This generally works, and I cannot tell what triggers the problem, Moreover,
> even where the bug occurs, the base pom is being correctly referenced, as
> the variable ${florence.server} does resolve, even when the env variable it
> references does not.
> 
> Using
> - Maven 2.1
> - Eclipse Maven Plugin 0.9.7 of 20081130
> --
> View this message in context:
> http://www.nabble.com/Maven2-ignoring-environment-variables-tp22845174p2284517
> 4.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
> 
>