Hi Philippe,
When using maven with shell, maven use my system properties which contains
this property:
MAVEN_OPTS=-Duser.home=c:\dev\apps\maven
The Verifier mechanism doesn't seem to use the system property.
Hm, maybe the environment variable MAVEN_OPTS just doesn't make it
properly through all the process forking:
main build
+ unit tests (forked by Surefire)
+ sub builds (forked by Verifier)
From a quick look at the Verifier sources, I would expect it to pass
all existing env variables on to the forked Maven build. Maybe Surefire
doesn't pass the variable through? If you sysout MAVEN_OPTS in one of
your unit tests, will it show up with your user.home properly set?
I may test the system properties for looking for a MAVEN_OPTS property and
parse it...
I wouldn't recommend to go parsing MAVEN_OPTS. If it's really just
Surefire not pushing your MAVEN_OPTS through, you might get the problem
solved by using Surefire's environmentVariables [0] parameter, e.g.
something like
<environmentVariables>
<MAVEN_OPTS>${env.MAVEN_OPTS}</MAVEN_OPTS>
</environmentVariables>
What I don't know right of my head is how this will behave in case
MAVEN_OPTS isn't set at all. If it produces garbage, this config might
need to be moved into a profile that is trigged via
<activation>
<property>
<name>env.MAVEN_OPTS</name>
</property>
</activation>
Benjamin
[0]
http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#environmentVariables
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email