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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: customtools-plugin
    • Labels:
      None
    • Environment:
      customtools-plugin version 0.1
    • Similar Issues:

      Description

      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?

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

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

            Show
            oleg_nenashev Oleg Nenashev added a comment - Pull request: https://github.com/jenkinsci/customtools-plugin/pull/5 I'll merge it into the next release
            Hide
            scm_issue_link 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>

            Show
            scm_issue_link 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>
            Hide
            oleg_nenashev Oleg Nenashev added a comment - - edited

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

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: