private void convertJdkPath ( Launcher launcher , EnvVars extendedEnv ) { String separator = launcher . isUnix ( ) ? "/" : "\\" ; String java_home = extendedEnv . get ( "JAVA_HOME" ) ; if ( StringUtils . isNotEmpty ( java_home ) ) { if ( ! StringUtils . endsWith ( java_home , separator ) ) { java_home += separator ; } extendedEnv . put ( "PATH+JDK" , java_home + "bin" ) ; } }
The Maven3Builder class is looking for the PATH + JDK environment variable due to legacy code . In The pipeline flow we need to convert the JAVA_HOME to PATH + JDK in order to reuse the code .