You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Taariq Levack <ta...@itaro.co.za> on 2010/08/04 13:09:52 UTC

Passing command line arguments to surefire plugin

Hi

My surefire configuration contains the following snippet...
<configuration>
  <systemPropertyVariables>
    <org.apache.cocoon.mode>dev</org.apache.cocoon.mode>

This works fine to set the system property -Dorg.apache.cocoon.mode=dev,
but what I really want is for the build deployer to set or override that property using a command line argument via Hudson
so he can deploy to different environments with a different argument.

If I run Maven from command line and pass in that argument or any other it doesn't reach Surefire, so the question is how to get
properties passed along to Surefire?

Thanks,
Taariq Levack

Re: Passing command line arguments to surefire plugin

Posted by Dan Tran <da...@gmail.com>.
ability to propagate command line system properties to surefire
regardless of forkmode is fixed at
http://jira.codehaus.org/browse/SUREFIRE-121

give the latest 2.6-SNAPSHOT a try

-D

On Wed, Aug 4, 2010 at 5:24 AM, Taariq Levack <ta...@itaro.co.za> wrote:
> That works.
> I guessed it had to do with forking so I removed the forkMode but the behaviour persisted, because as you say the default is to fork once.
>
> Thanks a lot.
>
> -----Original Message-----
> From: Aleksey Didik [mailto:didik@magenta-technology.ru]
> Sent: 04 August 2010 13:29
> To: Maven Users List
> Subject: Re: Passing command line arguments to surefire plugin
>
>  Hi,
> By default, surefire works in fork mode 'once' (new JVM) and all arguments passed from command line via Hudson will be available in base maven process, but not in surefire process.
>
> Try to use <forkMode>never</frokMode>.
>
> hth,
> Aleksey.
>
>
> 04.08.2010 15:09, Taariq Levack пишет:
>> Hi
>>
>> My surefire configuration contains the following snippet...
>> <configuration>
>>    <systemPropertyVariables>
>>      <org.apache.cocoon.mode>dev</org.apache.cocoon.mode>
>>
>> This works fine to set the system property
>> -Dorg.apache.cocoon.mode=dev, but what I really want is for the build
>> deployer to set or override that property using a command line argument via Hudson so he can deploy to different environments with a different argument.
>>
>> If I run Maven from command line and pass in that argument or any
>> other it doesn't reach Surefire, so the question is how to get properties passed along to Surefire?
>>
>> Thanks,
>> Taariq Levack
>>
>
>
> ---------------------------------------------------------------------
> 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: Passing command line arguments to surefire plugin

Posted by Taariq Levack <ta...@itaro.co.za>.
That works.
I guessed it had to do with forking so I removed the forkMode but the behaviour persisted, because as you say the default is to fork once.

Thanks a lot.

-----Original Message-----
From: Aleksey Didik [mailto:didik@magenta-technology.ru]
Sent: 04 August 2010 13:29
To: Maven Users List
Subject: Re: Passing command line arguments to surefire plugin

  Hi,
By default, surefire works in fork mode 'once' (new JVM) and all arguments passed from command line via Hudson will be available in base maven process, but not in surefire process.

Try to use <forkMode>never</frokMode>.

hth,
Aleksey.


04.08.2010 15:09, Taariq Levack пишет:
> Hi
>
> My surefire configuration contains the following snippet...
> <configuration>
>    <systemPropertyVariables>
>      <org.apache.cocoon.mode>dev</org.apache.cocoon.mode>
>
> This works fine to set the system property
> -Dorg.apache.cocoon.mode=dev, but what I really want is for the build
> deployer to set or override that property using a command line argument via Hudson so he can deploy to different environments with a different argument.
>
> If I run Maven from command line and pass in that argument or any
> other it doesn't reach Surefire, so the question is how to get properties passed along to Surefire?
>
> Thanks,
> Taariq Levack
>


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


Re: Passing command line arguments to surefire plugin

Posted by Aleksey Didik <di...@magenta-technology.ru>.
  Hi,
By default, surefire works in fork mode 'once' (new JVM) and all 
arguments passed from command line via Hudson will be available in base 
maven process,
but not in surefire process.

Try to use <forkMode>never</frokMode>.

hth,
Aleksey.


04.08.2010 15:09, Taariq Levack пишет:
> Hi
>
> My surefire configuration contains the following snippet...
> <configuration>
>    <systemPropertyVariables>
>      <org.apache.cocoon.mode>dev</org.apache.cocoon.mode>
>
> This works fine to set the system property -Dorg.apache.cocoon.mode=dev,
> but what I really want is for the build deployer to set or override that property using a command line argument via Hudson
> so he can deploy to different environments with a different argument.
>
> If I run Maven from command line and pass in that argument or any other it doesn't reach Surefire, so the question is how to get
> properties passed along to Surefire?
>
> Thanks,
> Taariq Levack
>


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