You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Dhondt, Edwin" <ed...@hp.com> on 2010/02/24 16:00:23 UTC

Passing system property

I'm using the combination Spring 2.5.6 TestContext Framework, JUnit 4.4.

I need to pass a system property so Spring can resolve it during it's property resolver fase.

I can start my IDE with a -D (e.g. -Duser.name=<myname>) option and when executing the JUnit test from within my IDE everything goes fine.

When running this same test using Maven 2 surefire plugin the test fails even when specifying -Duser.name=<myname> on the maven cmd line.

What am I doing wrong ?

How should I get this system property passed to the JVM in which the JUnit test is actually execution ?

Thanks,
EDH




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


Re: Passing system property

Posted by Anders Hammar <an...@hammar.net>.
The surefire doc should answer this:
http://maven.apache.org/plugins/maven-surefire-plugin/examples/system-properties.html

/Anders

On Wed, Feb 24, 2010 at 16:00, Dhondt, Edwin <ed...@hp.com> wrote:

> I'm using the combination Spring 2.5.6 TestContext Framework, JUnit 4.4.
>
> I need to pass a system property so Spring can resolve it during it's
> property resolver fase.
>
> I can start my IDE with a -D (e.g. -Duser.name=<myname>) option and when
> executing the JUnit test from within my IDE everything goes fine.
>
> When running this same test using Maven 2 surefire plugin the test fails
> even when specifying -Duser.name=<myname> on the maven cmd line.
>
> What am I doing wrong ?
>
> How should I get this system property passed to the JVM in which the JUnit
> test is actually execution ?
>
> Thanks,
> EDH
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>