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

JobDsl : Scripts not permitted to use method groovy.lang.GroovyObject

      When using job dsl with :

      pipelineJob('xxx') {
        triggers { 
          snapshotDependencies()
        }
      }

      I get the following error :

      ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean)

      It is recommended to not allow this call in script-approvals.

      Is this something "fixable" ?

      Thanks.

          [JENKINS-47560] JobDsl : Scripts not permitted to use method groovy.lang.GroovyObject

          Thomas CARSUZAN created issue -
          Thomas CARSUZAN made changes -
          Description Original: When using job dsl with :(

          pipelineJob('xxx') \{triggers \{
           snapshotDependencies(true)
          }
          New: When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies(true)
            }
          }{code}
          I get the following error :
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean)
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.
          Labels New: job-dsl job-dsl-plugin maven pipeline pipeline-maven script
          Thomas CARSUZAN made changes -
          Description Original: When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies(true)
            }
          }{code}
          I get the following error :
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean)
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.
          New: When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies(true)
            }
          }{code}
          I get the following error :
          {code:java}
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean){code}
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.
          Daniel Spilker made changes -
          Component/s New: job-dsl-plugin [ 16720 ]
          Component/s Original: pipeline-maven-plugin [ 21669 ]

          snapshotDependencies is only available for the Maven job type, but not for Pipeline jobs.

          See https://jenkinsci.github.io/job-dsl-plugin/#path/mavenJob-triggers-snapshotDependencies

           

           

           

          Daniel Spilker added a comment - snapshotDependencies is only available for the Maven job type, but not for Pipeline jobs. See https://jenkinsci.github.io/job-dsl-plugin/#path/mavenJob-triggers-snapshotDependencies      
          Daniel Spilker made changes -
          Assignee Original: Alvaro Lobato [ alobato ] New: Daniel Spilker [ daspilker ]
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Thomas CARSUZAN added a comment - This is not what is written here : https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin#PipelineMavenPlugin-Triggerdownstreampipelinewhenasnapshotisbuilt(since3.0.0 )
          Thomas CARSUZAN made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          Thomas CARSUZAN made changes -
          Description Original: When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies(true)
            }
          }{code}
          I get the following error :
          {code:java}
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean){code}
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.
          New: When using job dsl with :
          {code:java}
          pipelineJob('xxx') {
            triggers { 
              snapshotDependencies()
            }
          }{code}
          I get the following error :
          {code:java}
          ERROR: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (javaposse.jobdsl.dsl.helpers.triggers.TriggerContext snapshotDependencies java.lang.Boolean){code}
          It is recommended to not allow this call in script-approvals.

          Is this something "fixable" ?

          Thanks.

          I also tried it and it works with given jenkins/plugins version once the script method is allowed. 

          Thomas CARSUZAN added a comment - I also tried it and it works with given jenkins/plugins version once the script method is allowed. 

            daspilker Daniel Spilker
            tetradeus Thomas CARSUZAN
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: