Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13285

customtools-plugin does not delegate the Launcher.isUnix() call in DecoratedLauncher

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • customtools-plugin
    • None
    • customtools-plugin version 0.1

      When launching a Maven build from a Jenkins Unix master to a remote Windows slave the command line is incorrectly built because the customtools-plugin decorates the Launcher and fails to pass through the Launcher.isUnix() call to the decoratee. The result is that the classpath uses a path separator of ':' rather than ';' and Maven fails to load with a NoClassDefFoundError.

      The fix is simple. In com.cloudbees.jenkins.plugins.customtools.DecoratedLauncher just override the isUnix() call:

      com.cloudbees.jenkins.plugins.customtools.DecoratedLauncher
          @Override
          public boolean isUnix() {
              return inner.isUnix();
          }
      

      I'm not sure if there is a better way to do this in Jenkins. Decorating Launcher by subclassing in this way looks prone to this error if plugins fail to decorate all public methods. Perhaps Jenkins core offers a better approach?

          [JENKINS-13285] customtools-plugin does not delegate the Launcher.isUnix() call in DecoratedLauncher

          Oleg Nenashev added a comment -

          Pull request: https://github.com/jenkinsci/customtools-plugin/pull/5
          I'll merge it into the next release

          Oleg Nenashev added a comment - Pull request: https://github.com/jenkinsci/customtools-plugin/pull/5 I'll merge it into the next release

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/customtools/DecoratedLauncher.java
          http://jenkins-ci.org/commit/customtools-plugin/30df5544795942eb2020079c7590e863d42a39c1
          Log:
          Added overrides for all overridable methods ofDecoratedLauncher
          Resolves: https://issues.jenkins-ci.org/browse/JENKINS-13285

          Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/cloudbees/jenkins/plugins/customtools/DecoratedLauncher.java http://jenkins-ci.org/commit/customtools-plugin/30df5544795942eb2020079c7590e863d42a39c1 Log: Added overrides for all overridable methods ofDecoratedLauncher Resolves: https://issues.jenkins-ci.org/browse/JENKINS-13285 Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

          Oleg Nenashev added a comment - - edited

          Decorated Launcher invokes all methods from the inner launcher (@since 0.3)

          Oleg Nenashev added a comment - - edited Decorated Launcher invokes all methods from the inner launcher (@since 0.3)

            oleg_nenashev Oleg Nenashev
            tsmith Tim Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: