diff --git a/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java b/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java index 8f843573..eebb6a46 100644 --- a/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java +++ b/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java @@ -145,7 +145,7 @@ class WithMavenStepExecution2 extends GeneralNonBlockingStepExecution { private transient FilePath tempBinDir; /** - * Indicates if running on docker with docker.image() or container() + * Indicates if running on docker with docker.image() */ private boolean withContainer; @@ -238,7 +238,7 @@ protected boolean doStart() throws Exception { } /** - * Detects if this step is running inside docker.image() or container() + * Detects if this step is running inside docker.image() *

* This has the following implications: *

  • Tool installers do no work, as they install in the host, see: @@ -247,24 +247,17 @@ protected boolean doStart() throws Exception { * container running the sh command for maven This is due to the fact that docker.image() all it * does is decorate the launcher and execute the command with a docker run which means that the inherited * environment from the OS will be totally different eg: MAVEN_HOME, JAVA_HOME, PATH, etc. - *
  • Kubernetes' container() support is still in early stages, and environment variables might not be - * completely configured, depending on the version of the Jenkins Kubernetes plugin. * - * @return true if running inside a container with docker.image() or container() + * @return true if running inside a container with docker.image() * @see - * WithContainerStep and - * ContainerStep + * WithContainerStep */ private boolean detectWithContainer() throws IOException { Launcher launcher1 = launcher; while (launcher1 instanceof Launcher.DecoratedLauncher) { String launcherClassName = launcher1.getClass().getName(); - if (launcherClassName.contains("ContainerExecDecorator")) { - LOGGER.log(Level.FINE, "Step running within Kubernetes container(): {0}", launcherClassName); - return true; - } + // ToDo: add support for container() step (ContainerExecDecorator) from Kubernetes plugin if (launcherClassName.contains("WithContainerStep")) { LOGGER.log(Level.FINE, "Step running within docker.image(): {0}", launcherClassName);