L.S.,

We are trying to set an environment variable for a unit test by adding it to
the maven-surefire-plugin configuration as in :
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>pertest</forkMode>
          <environmentVariables>
            <activemq.port1>${port1}</activemq.port1>
          </environmentVariables>
        </configuration>
      </plugin>

However, the environment variable is not available in the unit test, doing a
System.getenv("activemq.port1") returns null.  This only happens on AIX
(V5.3, using Java 6), it seems to work fine on Windows and Linux.

I have already run mvn with -X flag and see the log when the environment
variable is being set:
[DEBUG] Using JVM: /opt/tools/pfm/jdk16_64_sr6/jre/bin/java
[DEBUG] Setting environment variable [activemq.port1]=[61811]

Any suggestions on what else I can do to fix/troubleshoot the issue?

Regards,

Gert


-----
---
Gert Vanthienen
http://gertvanthienen.blogspot.com
-- 
View this message in context: 
http://old.nabble.com/Environment-variables-set-by-maven-surefire-plugin-not-available-in-test-tp27077406p27077406.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to