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

Unable to use custom SCM plugin Extension Point

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • job-dsl-plugin
    • None

      I implemented below code to extend my scm plugin for Dsl . The job gets created but the scm step is not added as expected in the created job

      //file:DslExtension.java
      import hudson.Extension;
      import javaposse.jobdsl.dsl.helpers.ScmContext;

      import javaposse.jobdsl.plugin.ContextExtensionPoint;
      import javaposse.jobdsl.plugin.DslExtensionMethod;

      @Extension(optional = true)
      public class JobDslExtension extends ContextExtensionPoint{

      @DslExtensionMethod(context = ScmContext.class)
      public Object CustomMethodDsl(String hostName, int port, String testpath, String userName, String password, String testdata)

      { return new CustomClientSCM(hostName, port,testpath, userName,password, testdata); }

      }

      // File:Job Dsl Script

      job('example') {
      scm

      { CustomMethodDsl('hostName',123, 'testpath', ' userName', ' password', 'testdata') }

      }

            daspilker Daniel Spilker
            touseef Touseef
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: