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

job-dsl-plugin unknown protocol when use in dir with mixed separator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • job-dsl-plugin
    • Windows Server 2008 R2
      JRE 1.8.0_144-b01
    • job-dsl 1.77

      If use separator '/' in dir, then jobDsl will throw java.net.MalformedURLException: unknown protocol

      When change it to '
      ', it's ok.

              stage('Deploy') {
                  steps {
                      echo 'Add deploy scheduling job...'
                      //THERE
                      dir("${params.DeployPath}/${env.ArchiveName}") {
                          jobDsl(
                              targets: "${params.ProjectName}/jenkins/job_dsl.groovy", 
                              removedJobAction: 'DELETE', 
                              removedViewAction: 'DELETE',
                              additionalParameters: [
                                  ProjectPath: "${params.DeployPath}/${env.ArchiveName}/${params.ProjectName}"
                              ]
                          )
                      }
                  }
              }
      

       

       

       this is the error log,

       ...
       [Pipeline] stage
       [Pipeline] { (Deploy)
       [Pipeline] dir
       Running in D:\Program\ETL/[Deploy]DataCenter_20180929_100210_0fe69c1
       [Pipeline] { 
       [Pipeline] echo
       Add deploy scheduling job... 
       [Pipeline] jobDsl 
       [Pipeline] }
       [Pipeline] // dir
       [Pipeline] }
       [Pipeline] // stage
       [Pipeline] }
       [Pipeline] // node
       [Pipeline] End of Pipeline
       java.net.MalformedURLException: unknown protocol: d
       at java.net.URL.<init>(Unknown Source)
       at java.net.URL.<init>(Unknown Source)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
       at java.lang.reflect.Constructor.newInstance(Unknown Source)
       at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
       at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
       at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
       at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:255)
       at javaposse.jobdsl.plugin.ScriptRequestGenerator.createWorkspaceUrl(ScriptRequestGenerator.groovy:93)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
       at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
       at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
       at javaposse.jobdsl.plugin.ScriptRequestGenerator$_getScriptRequests_closure2.doCall(ScriptRequestGenerator.groovy:50)
       at sun.reflect.GeneratedMethodAccessor1908.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
       at groovy.lang.Closure.call(Closure.java:414)
       at groovy.lang.Closure.call(Closure.java:430)
       at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040)
       at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1895)
       at org.codehaus.groovy.runtime.dgm$159.invoke(Unknown Source)
       at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
       at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
       at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
       at javaposse.jobdsl.plugin.ScriptRequestGenerator.getScriptRequests(ScriptRequestGenerator.groovy:42)
       at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:326)
       at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
       at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
       at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:50)
       at hudson.security.ACL.impersonate(ACL.java:290)
       at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:47)
       at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
       at java.util.concurrent.FutureTask.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
       at java.lang.Thread.run(Unknown Source)
       Finished: FAILURE
      
      

       

            daspilker Daniel Spilker
            xiaoyao9184 XiaoYao LingHu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: