Skip to content

Commit

Permalink
[fix JENKINS-28294] Improve the ERROR message when a Maven project is…
Browse files Browse the repository at this point in the history
… launched with a java version < to the minimum version required by the master. (#58)

Examples:
* Jenkins >= 1.612 requires Java 7 thus Maven jobs must be launched with Java >= 7
* Jenkins >= 1.520 requires Java 6 thus Maven jobs must be launched with Java >= 6
  • Loading branch information
aheritier committed Oct 16, 2016
1 parent 01c60df commit 81dd5ee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/hudson/maven/AbstractMavenProcessFactory.java
Expand Up @@ -299,7 +299,15 @@ Computer.threadPoolForRemoting, new BufferedInputStream(con.in), new BufferedOut
if (originalJdk == null) { // so we only try this once
for (Throwable t = x; t != null; t = t.getCause()) {
if (t instanceof UnsupportedClassVersionError || t instanceof SocketException) {
listener.error("[JENKINS-18403] JDK 5 not supported to run Maven; retrying with slave Java and setting compile/test properties to point to " + jdk.getHome());
listener.error("================================================================================");
listener.error("Invalid project setup: "+t.getMessage());
listener.error("[JENKINS-18403][JENKINS-28294] JDK '" + jdk.getName() +
"' not supported to run Maven projects.");
listener.error("Maven projects have to be launched with a Java version greater or equal to the minimum version required by the master.");
listener.error("Use the Maven JDK Toolchains (plugin) to build your maven project with an older JDK.");
listener.error("Retrying with slave Java and setting compile/test properties to point to " +
jdk.getHome() + ".");
listener.error("================================================================================");
originalJdk = jdk;
jdk = launcher.getChannel().call(new FindJavaHome());
continue JDK;
Expand Down

0 comments on commit 81dd5ee

Please sign in to comment.