Skip to content
Permalink
Browse files

[fix JENKINS-28294] Improve the ERROR message when a Maven project is…

… 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 81dd5ee4eb76ce1b8f41fde753ca5c46d52cd4be
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/main/java/hudson/maven/AbstractMavenProcessFactory.java
@@ -299,7 +299,15 @@ public String call() throws IOException {
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;

0 comments on commit 81dd5ee

Please sign in to comment.
You can’t perform that action at this time.