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

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

XMLWordPrintable

    • 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?

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

              Created:
              Updated:
              Resolved: