Hi,
today, the Hudson job for the Maven Release Plugin started failing [0].
In detail, the IT "invoker-basic" failed due to the Maven Release Plugin
getting configured with
mavenHome =
H:\home_hudson\.hudson\workspace\Maven-release-trunk\jdk\1.5\label\windows\trunk\maven-release-plugin\target\it\invoker-basic\opt\maven\apache-maven-2.0.9
i.e. it's appending the Maven home to the current directory which
apparently doesn't work well. The plugin parameter mavenHome is of type
java.io.File and configured via default-value="${maven.home}".
The only commit between build #14 and the previously successful build
#13 was related to the site, so the cause for this failure was likely
switching the job from Maven 2.1.0-M1 to Maven 2.0.9 and indeed
switching back made it pass again (#16).
The relevant difference between these Maven versions is the value for
DefaultPathTranslator.FILE_SEPARATOR. In 2.0.9, it's hard-coded to "/",
in 2.1.0-M1 it's the platform-specific separator. The latter
successfully spares a path like "\opt\maven\apache-maven-2.0.9" from
being basedir aligned on Windows.
To summarize:
1) Hudson runs Maven by setting M2_HOME=/opt/maven/..., even on Windows
2) The mvn.bat passes M2_HOME literally into maven.home
3) The Release Plugin picks maven.home for a basedir aligned File param
Now my question, how do we want to handle that smoothly on the grid? I
see three options:
a) Simply avoid using Maven 2.0.x for affected builds
b) Update the path translation in Maven 2.0.x to match 2.1.x
c) Update the *.bat files to ensure M2_HOME is absolute
d) Update MavenCli or similar to fix maven.home
Option c) seems to be as easy as
for %%i in ("%M2_HOME%") do set "M2_HOME=%%~fi"
but I haven't fully tried the patch yet.
Option c) or d) are my favorites as I personally dislike the grid env
for Windows: it's just unnatural, how many Windows users run Maven with
a unix-style home dir? I see ourselves testing an exotic environment and
chasing issues a regular Windows user would never face. Hence I believe
it's worth to get rid of Hudson anomalies at the front door.
WDYT?
Benjamin
[0]
https://grid.sonatype.org/ci/job/Maven-release-trunk/jdk=1.5,label=windows/14/console
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]