Passing System Properties and Environment Variables to unit tests in Maven – Update
Unfortunately there was an bug in my previous post.
I had naively assumed that the syntax for environment variables was the same as for system properties but alas not.
The correct code is:
<build>
<defaultGoal>package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<environmentVariables>
<SOME_ENV_VARIABLE>some value</SOME_ENV_VARIABLE>
</environmentVariables>
<systemProperties>
<property>
<name>acceptance.test.host</name>
<value>${acceptance.test.host}</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
