You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stephen Connolly <st...@gmail.com> on 2009/04/20 11:55:21 UTC

Re: maven 2.1.0 not passing on system properties to java virtual machine

Have you locked down the version of surefire you are using in your pom?

if you have not locked it down, then you will be picking up a newer
version of surefire with 2.1.0.

AFAIK, a newer version of surefire has issues passing system
properties to the forked process.

in any case you should always lock down the versions of plugins that
you are using or else your build is not fully reproducible

-Stephen

2009/4/20 edward eric pedersson <cp...@googlemail.com>:
> Hi
>
> We use the command line to pass on system properties to the java
> virtual machine when running our Hudson builds on a Linux box. It used
> to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has
> stopped working altogether. The system properties just never make it
> to the java virtual machine.
>
> I have created a small test project and indeed it does not work at
> all. I have attached it in case you want to give it a go. [it got
> blocked so sending without attachment]
>
> This should work just fine with maven 2.0.9
>
> mvn2.0.9 -Dsystem.test.property=test test
>
> But this will fail
>
> mvn2.1 -Dsystem.test.property=test test
>
> The java code simply does this
>
> assertTrue( System.getProperty("system.test.property") != null);
>
>
> Any thoughts
>
> --
>
>
> -- e
>
> ---------------------------------------------------------------------
> 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: maven 2.1.0 not passing on system properties to java virtual machine

Posted by Martin Gainty <mg...@hotmail.com>.
i was told the passing hierarchy is

System(OS)
passes to
JVM
passes to
Maven

Maven cannot populate properties up to parent JVM (so other JVM threads can use them)
JVM cannot populate properties to System-OS space (so other system processes can use them)

please confirm,
Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.






> Date: Mon, 20 Apr 2009 12:57:54 +0100
> Subject: Re: maven 2.1.0 not passing on system properties to java virtual 	machine
> From: cpsmadness@googlemail.com
> To: users@maven.apache.org
> 
> yes you are right.
> 
> It seems 2.4.3 of the plugin is broken but 2.4.2 works just fine.
> 
> will lock down the version is the pom.
> 
> thanks for your help
> 
> 2009/4/20 Stephen Connolly <st...@gmail.com>:
> > Have you locked down the version of surefire you are using in your pom?
> >
> > if you have not locked it down, then you will be picking up a newer
> > version of surefire with 2.1.0.
> >
> > AFAIK, a newer version of surefire has issues passing system
> > properties to the forked process.
> >
> > in any case you should always lock down the versions of plugins that
> > you are using or else your build is not fully reproducible
> >
> > -Stephen
> >
> > 2009/4/20 edward eric pedersson <cp...@googlemail.com>:
> >> Hi
> >>
> >> We use the command line to pass on system properties to the java
> >> virtual machine when running our Hudson builds on a Linux box. It used
> >> to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has
> >> stopped working altogether. The system properties just never make it
> >> to the java virtual machine.
> >>
> >> I have created a small test project and indeed it does not work at
> >> all. I have attached it in case you want to give it a go. [it got
> >> blocked so sending without attachment]
> >>
> >> This should work just fine with maven 2.0.9
> >>
> >> mvn2.0.9 -Dsystem.test.property=test test
> >>
> >> But this will fail
> >>
> >> mvn2.1 -Dsystem.test.property=test test
> >>
> >> The java code simply does this
> >>
> >> assertTrue( System.getProperty("system.test.property") != null);
> >>
> >>
> >> Any thoughts
> >>
> >> --
> >>
> >>
> >> -- e
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> 
> 
> 
> -- 
> 
> 
> -- e
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

_________________________________________________________________
Windows Live™: Life without walls.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1b_explore_042009

Re: maven 2.1.0 not passing on system properties to java virtual machine

Posted by Frédéric Camblor <fc...@gmail.com>.
John,
I am in the same case of edward and want to "enable/disable" test "families"
while executing my maven builds.

For instance, I'll want to execute every "data access tests" once per day
-and not after each commits because it takes time !-
For some other tests, I'd like to execute only selenium tests (which rely on
deployed app and take long long time too) => this tests will be planned
twice per week.

My personnal test framework allows to "tag" tests with families in order to
execute (or not) tests depending on system properties.

By exemple, if I run :
mvn test -Dtest.families.includes=SELENIUM,DATA_ACCESS
every "heavy" tests (tests which take a long time to execute !) will be
executed.
Moreover, I'll be able to execute "regression pre-emptive" tests after each
commits by executing the following command line :
mvn test -Dtest.families.includes=NON-REGRESSION

I can't see how I could define these "per-build" properties (neither in
MAVEN_OPTS nor in my pom.xml file since it will be defined for every build I
run !) except by defining some profiles for that.
I don't really thing this would be the better way since I could have lots of
profiles (for now on, I have approx 6-7 test families ... and I don't want
to make a cartesian product of all of these families with profiles !)


2009/4/20 John Casey <jd...@commonjava.org>

> Another couple things to consider:
>
> 1. in Surefire, you should probably use the systemProperties to pass on
> system properties explicitly. Just a suggestion.
>
> 2. For actual system properties, it might be wiser to set them in
> MAVEN_OPTS instead of the mvn -D option. This is because Maven has
> deprecated the propagation of -D options into system properties, in order to
> make it a little friendlier for people trying to run multiple maven
> instances in a single JVM (without getting cross-pollution of sysprops).
>
>  Using MAVEN_OPTS (which IIRC you can set in Hudson), you can still specify
> '-Dsystem.property=foo' and have it work fine.
>
> -john
>
>
> edward eric pedersson wrote:
>
>> yes you are right.
>>
>> It seems 2.4.3 of the plugin is broken but 2.4.2 works just fine.
>>
>> will lock down the version is the pom.
>>
>> thanks for your help
>>
>> 2009/4/20 Stephen Connolly <st...@gmail.com>:
>>
>>> Have you locked down the version of surefire you are using in your pom?
>>>
>>> if you have not locked it down, then you will be picking up a newer
>>> version of surefire with 2.1.0.
>>>
>>> AFAIK, a newer version of surefire has issues passing system
>>> properties to the forked process.
>>>
>>> in any case you should always lock down the versions of plugins that
>>> you are using or else your build is not fully reproducible
>>>
>>> -Stephen
>>>
>>> 2009/4/20 edward eric pedersson <cp...@googlemail.com>:
>>>
>>>> Hi
>>>>
>>>> We use the command line to pass on system properties to the java
>>>> virtual machine when running our Hudson builds on a Linux box. It used
>>>> to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has
>>>> stopped working altogether. The system properties just never make it
>>>> to the java virtual machine.
>>>>
>>>> I have created a small test project and indeed it does not work at
>>>> all. I have attached it in case you want to give it a go. [it got
>>>> blocked so sending without attachment]
>>>>
>>>> This should work just fine with maven 2.0.9
>>>>
>>>> mvn2.0.9 -Dsystem.test.property=test test
>>>>
>>>> But this will fail
>>>>
>>>> mvn2.1 -Dsystem.test.property=test test
>>>>
>>>> The java code simply does this
>>>>
>>>> assertTrue( System.getProperty("system.test.property") != null);
>>>>
>>>>
>>>> Any thoughts
>>>>
>>>> --
>>>>
>>>>
>>>> -- e
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>>
>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Frédéric Camblor

Re: maven 2.1.0 not passing on system properties to java virtual machine

Posted by Frederic Camblor <fc...@gmail.com>.
John,
I am in the same case of edward and want to "enable/disable" test "families"
while executing my maven builds.

For instance, I'll want to execute every "data access tests" once per day
-and not after each commits because it takes time !-
For some other tests, I'd like to execute only selenium tests (which rely on
deployed app and take long long time too) => this tests will be planned
twice per week.

My personnal test framework allows to "tag" tests with families in order to
execute (or not) tests depending on system properties.

By exemple, if I run :
mvn test -Dtest.families.includes=SELENIUM,DATA_ACCESS
every "heavy" tests (tests which take a long time to execute !) will be
executed.
Moreover, I'll be able to execute "regression pre-emptive" tests after each
commits by executing the following command line :
mvn test -Dtest.families.includes=NON-REGRESSION

I can't see how I could define these "per-build" properties (neither in
MAVEN_OPTS nor in my pom.xml file since it will be defined for every build I
run !) except by defining some profiles for that.
I don't really thing this would be the better way since I could have lots of
profiles (for now on, I have approx 6-7 test families ... and I don't want
to make a cartesian product of all of these families with profiles !)


2009/4/20 John Casey <jd...@commonjava.org>

> Another couple things to consider:
>
> 1. in Surefire, you should probably use the systemProperties to pass on
> system properties explicitly. Just a suggestion.
>
> 2. For actual system properties, it might be wiser to set them in
> MAVEN_OPTS instead of the mvn -D option. This is because Maven has
> deprecated the propagation of -D options into system properties, in order to
> make it a little friendlier for people trying to run multiple maven
> instances in a single JVM (without getting cross-pollution of sysprops).
>
>  Using MAVEN_OPTS (which IIRC you can set in Hudson), you can still specify
> '-Dsystem.property=foo' and have it work fine.
>
> -john
>
>
> edward eric pedersson wrote:
>
>> yes you are right.
>>
>> It seems 2.4.3 of the plugin is broken but 2.4.2 works just fine.
>>
>> will lock down the version is the pom.
>>
>> thanks for your help
>>
>> 2009/4/20 Stephen Connolly <st...@gmail.com>:
>>
>>> Have you locked down the version of surefire you are using in your pom?
>>>
>>> if you have not locked it down, then you will be picking up a newer
>>> version of surefire with 2.1.0.
>>>
>>> AFAIK, a newer version of surefire has issues passing system
>>> properties to the forked process.
>>>
>>> in any case you should always lock down the versions of plugins that
>>> you are using or else your build is not fully reproducible
>>>
>>> -Stephen
>>>
>>> 2009/4/20 edward eric pedersson <cp...@googlemail.com>:
>>>
>>>> Hi
>>>>
>>>> We use the command line to pass on system properties to the java
>>>> virtual machine when running our Hudson builds on a Linux box. It used
>>>> to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has
>>>> stopped working altogether. The system properties just never make it
>>>> to the java virtual machine.
>>>>
>>>> I have created a small test project and indeed it does not work at
>>>> all. I have attached it in case you want to give it a go. [it got
>>>> blocked so sending without attachment]
>>>>
>>>> This should work just fine with maven 2.0.9
>>>>
>>>> mvn2.0.9 -Dsystem.test.property=test test
>>>>
>>>> But this will fail
>>>>
>>>> mvn2.1 -Dsystem.test.property=test test
>>>>
>>>> The java code simply does this
>>>>
>>>> assertTrue( System.getProperty("system.test.property") != null);
>>>>
>>>>
>>>> Any thoughts
>>>>
>>>> --
>>>>
>>>>
>>>> -- e
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>>
>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: maven 2.1.0 not passing on system properties to java virtual machine

Posted by John Casey <jd...@commonjava.org>.
Well, if you want, go ahead and file a JIRA for it in 
http://jira.codehaus.org/browse/MNG and we can at least take a look to 
make sure there isn't a better way.

FWIW, if you put the systemProperties entry in place with a value of 
'${system.property}', then use -Dsystem.property=foo in the mvn command 
line, that will probably work. It's at least something to try.

-john

edward eric pedersson wrote:
> I need to pass the options on the command line so using
> systemProperties might not work for me unless I misunderstand what you
> mean.
> 
> How do you pass the -DpropertyName using the MAVEN_OPTS ? I m pretty
> sure that was the first thing I tried before adding them as system
> properties properly as described in my email earlier.
> 
> I did search for documentation but it was kind of sparse.
> 
> 2009/4/20 John Casey <jd...@commonjava.org>:
>> Another couple things to consider:
>>
>> 1. in Surefire, you should probably use the systemProperties to pass on
>> system properties explicitly. Just a suggestion.
>>
>> 2. For actual system properties, it might be wiser to set them in MAVEN_OPTS
>> instead of the mvn -D option. This is because Maven has deprecated the
>> propagation of -D options into system properties, in order to make it a
>> little friendlier for people trying to run multiple maven instances in a
>> single JVM (without getting cross-pollution of sysprops).
>>
>>  Using MAVEN_OPTS (which IIRC you can set in Hudson), you can still specify
>> '-Dsystem.property=foo' and have it work fine.
>>
>> -john
>>
>> edward eric pedersson wrote:
>>> yes you are right.
>>>
>>> It seems 2.4.3 of the plugin is broken but 2.4.2 works just fine.
>>>
>>> will lock down the version is the pom.
>>>
>>> thanks for your help
>>>
>>> 2009/4/20 Stephen Connolly <st...@gmail.com>:
>>>> Have you locked down the version of surefire you are using in your pom?
>>>>
>>>> if you have not locked it down, then you will be picking up a newer
>>>> version of surefire with 2.1.0.
>>>>
>>>> AFAIK, a newer version of surefire has issues passing system
>>>> properties to the forked process.
>>>>
>>>> in any case you should always lock down the versions of plugins that
>>>> you are using or else your build is not fully reproducible
>>>>
>>>> -Stephen
>>>>
>>>> 2009/4/20 edward eric pedersson <cp...@googlemail.com>:
>>>>> Hi
>>>>>
>>>>> We use the command line to pass on system properties to the java
>>>>> virtual machine when running our Hudson builds on a Linux box. It used
>>>>> to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has
>>>>> stopped working altogether. The system properties just never make it
>>>>> to the java virtual machine.
>>>>>
>>>>> I have created a small test project and indeed it does not work at
>>>>> all. I have attached it in case you want to give it a go. [it got
>>>>> blocked so sending without attachment]
>>>>>
>>>>> This should work just fine with maven 2.0.9
>>>>>
>>>>> mvn2.0.9 -Dsystem.test.property=test test
>>>>>
>>>>> But this will fail
>>>>>
>>>>> mvn2.1 -Dsystem.test.property=test test
>>>>>
>>>>> The java code simply does this
>>>>>
>>>>> assertTrue( System.getProperty("system.test.property") != null);
>>>>>
>>>>>
>>>>> Any thoughts
>>>>>
>>>>> --
>>>>>
>>>>>
>>>>> -- e
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>>
>>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> 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: maven 2.1.0 not passing on system properties to java virtual machine

Posted by edward eric pedersson <cp...@googlemail.com>.
I need to pass the options on the command line so using
systemProperties might not work for me unless I misunderstand what you
mean.

How do you pass the -DpropertyName using the MAVEN_OPTS ? I m pretty
sure that was the first thing I tried before adding them as system
properties properly as described in my email earlier.

I did search for documentation but it was kind of sparse.

2009/4/20 John Casey <jd...@commonjava.org>:
> Another couple things to consider:
>
> 1. in Surefire, you should probably use the systemProperties to pass on
> system properties explicitly. Just a suggestion.
>
> 2. For actual system properties, it might be wiser to set them in MAVEN_OPTS
> instead of the mvn -D option. This is because Maven has deprecated the
> propagation of -D options into system properties, in order to make it a
> little friendlier for people trying to run multiple maven instances in a
> single JVM (without getting cross-pollution of sysprops).
>
>  Using MAVEN_OPTS (which IIRC you can set in Hudson), you can still specify
> '-Dsystem.property=foo' and have it work fine.
>
> -john
>
> edward eric pedersson wrote:
>>
>> yes you are right.
>>
>> It seems 2.4.3 of the plugin is broken but 2.4.2 works just fine.
>>
>> will lock down the version is the pom.
>>
>> thanks for your help
>>
>> 2009/4/20 Stephen Connolly <st...@gmail.com>:
>>>
>>> Have you locked down the version of surefire you are using in your pom?
>>>
>>> if you have not locked it down, then you will be picking up a newer
>>> version of surefire with 2.1.0.
>>>
>>> AFAIK, a newer version of surefire has issues passing system
>>> properties to the forked process.
>>>
>>> in any case you should always lock down the versions of plugins that
>>> you are using or else your build is not fully reproducible
>>>
>>> -Stephen
>>>
>>> 2009/4/20 edward eric pedersson <cp...@googlemail.com>:
>>>>
>>>> Hi
>>>>
>>>> We use the command line to pass on system properties to the java
>>>> virtual machine when running our Hudson builds on a Linux box. It used
>>>> to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has
>>>> stopped working altogether. The system properties just never make it
>>>> to the java virtual machine.
>>>>
>>>> I have created a small test project and indeed it does not work at
>>>> all. I have attached it in case you want to give it a go. [it got
>>>> blocked so sending without attachment]
>>>>
>>>> This should work just fine with maven 2.0.9
>>>>
>>>> mvn2.0.9 -Dsystem.test.property=test test
>>>>
>>>> But this will fail
>>>>
>>>> mvn2.1 -Dsystem.test.property=test test
>>>>
>>>> The java code simply does this
>>>>
>>>> assertTrue( System.getProperty("system.test.property") != null);
>>>>
>>>>
>>>> Any thoughts
>>>>
>>>> --
>>>>
>>>>
>>>> -- e
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 


-- e

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


Re: maven 2.1.0 not passing on system properties to java virtual machine

Posted by John Casey <jd...@commonjava.org>.
Another couple things to consider:

1. in Surefire, you should probably use the systemProperties to pass on 
system properties explicitly. Just a suggestion.

2. For actual system properties, it might be wiser to set them in 
MAVEN_OPTS instead of the mvn -D option. This is because Maven has 
deprecated the propagation of -D options into system properties, in 
order to make it a little friendlier for people trying to run multiple 
maven instances in a single JVM (without getting cross-pollution of 
sysprops).

   Using MAVEN_OPTS (which IIRC you can set in Hudson), you can still 
specify '-Dsystem.property=foo' and have it work fine.

-john

edward eric pedersson wrote:
> yes you are right.
> 
> It seems 2.4.3 of the plugin is broken but 2.4.2 works just fine.
> 
> will lock down the version is the pom.
> 
> thanks for your help
> 
> 2009/4/20 Stephen Connolly <st...@gmail.com>:
>> Have you locked down the version of surefire you are using in your pom?
>>
>> if you have not locked it down, then you will be picking up a newer
>> version of surefire with 2.1.0.
>>
>> AFAIK, a newer version of surefire has issues passing system
>> properties to the forked process.
>>
>> in any case you should always lock down the versions of plugins that
>> you are using or else your build is not fully reproducible
>>
>> -Stephen
>>
>> 2009/4/20 edward eric pedersson <cp...@googlemail.com>:
>>> Hi
>>>
>>> We use the command line to pass on system properties to the java
>>> virtual machine when running our Hudson builds on a Linux box. It used
>>> to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has
>>> stopped working altogether. The system properties just never make it
>>> to the java virtual machine.
>>>
>>> I have created a small test project and indeed it does not work at
>>> all. I have attached it in case you want to give it a go. [it got
>>> blocked so sending without attachment]
>>>
>>> This should work just fine with maven 2.0.9
>>>
>>> mvn2.0.9 -Dsystem.test.property=test test
>>>
>>> But this will fail
>>>
>>> mvn2.1 -Dsystem.test.property=test test
>>>
>>> The java code simply does this
>>>
>>> assertTrue( System.getProperty("system.test.property") != null);
>>>
>>>
>>> Any thoughts
>>>
>>> --
>>>
>>>
>>> -- e
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
> 
> 
> 

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


Re: maven 2.1.0 not passing on system properties to java virtual machine

Posted by edward eric pedersson <cp...@googlemail.com>.
yes you are right.

It seems 2.4.3 of the plugin is broken but 2.4.2 works just fine.

will lock down the version is the pom.

thanks for your help

2009/4/20 Stephen Connolly <st...@gmail.com>:
> Have you locked down the version of surefire you are using in your pom?
>
> if you have not locked it down, then you will be picking up a newer
> version of surefire with 2.1.0.
>
> AFAIK, a newer version of surefire has issues passing system
> properties to the forked process.
>
> in any case you should always lock down the versions of plugins that
> you are using or else your build is not fully reproducible
>
> -Stephen
>
> 2009/4/20 edward eric pedersson <cp...@googlemail.com>:
>> Hi
>>
>> We use the command line to pass on system properties to the java
>> virtual machine when running our Hudson builds on a Linux box. It used
>> to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has
>> stopped working altogether. The system properties just never make it
>> to the java virtual machine.
>>
>> I have created a small test project and indeed it does not work at
>> all. I have attached it in case you want to give it a go. [it got
>> blocked so sending without attachment]
>>
>> This should work just fine with maven 2.0.9
>>
>> mvn2.0.9 -Dsystem.test.property=test test
>>
>> But this will fail
>>
>> mvn2.1 -Dsystem.test.property=test test
>>
>> The java code simply does this
>>
>> assertTrue( System.getProperty("system.test.property") != null);
>>
>>
>> Any thoughts
>>
>> --
>>
>>
>> -- e
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 


-- e

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


Re: maven 2.1.0 not passing on system properties to java virtual machine

Posted by raisercostin <ra...@gmail.com>.
I don't think is a problem in either maven or surefire plugin.
Else the surefire is behaving differently.

It looks like now, when surefire forks the jvm, will not take all the system
properties from the parent jvm.
That's why you should pass whatever system properties you want for the
tests, using argLine.

So, both these should work


mvn2.1 -Dsystem.test.property=test test -DforkMode=never


or


mvn2.1 test -DargLine="-Dsystem.test.property=test"



, costin
-- 
View this message in context: http://www.nabble.com/maven-2.1.0-not-passing-on-system-properties-to-java-virtual-machine-tp23133501p23383667.html
Sent from the Maven - Users mailing list archive at Nabble.com.