-
Bug
-
Resolution: Unresolved
-
Blocker
-
None
-
Jenkins 2.33
Script Security 1.24
Artifactory 2.8.1
Gradle 1.25
In code that attempts to publish to artifactory using gradle I can't set the usesPlugin property like:
def rtGradle = Artifactory.newGradleBuild()
rtGradle.tool = "Gradle_2_14_1"
rtGradle.setUsesPlugin(true)
causes: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified method org.jfrog.hudson.pipeline.types.GradleBuild setUsesPlugin java.lang.Boolean
Which is @Whitelisted according to:
https://github.com/jenkinsci/artifactory-plugin/blob/artifactory-2.8.1/src/main/java/org/jfrog/hudson/pipeline/types/deployers/GradleDeployer.java#L46
The documented way to set this boolean is:
rtGradle.usesPlugin = true
but that causes: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: unclassified field org.jfrog.hudson.pipeline.types.GradleBuild usesPlugin
My /scriptApproval/ shows nothing to approve.
[JENKINS-39943] Artifactory gradle usage has wrong documentation for GradleDeployer.usesPlugin usage
Component/s | New: artifactory-plugin [ 15689 ] | |
Summary | Original: script approvals broken | New: unclassified method org.jfrog.hudson.pipeline.types.GradleBuild setUsesPlugin java.lang.Boolean |
Assignee | New: Eyal Ben Moshe [ eyalbe ] |
Component/s | Original: script-security-plugin [ 18520 ] |
Summary | Original: unclassified method org.jfrog.hudson.pipeline.types.GradleBuild setUsesPlugin java.lang.Boolean | New: Artifactory gradle usage has wrong documentation for GradleDeployer.usesPlugin usage |
Assignee | Original: Eyal Ben Moshe [ eyalbe ] | New: Eyal Ben Moshe [ eyalb ] |
Any “unclassified” error means that script-security could not even figure out what method you are trying to call, so whether that method is in fact whitelisted is irrelevant. No idea offhand why that would be thrown in this case; usually the result of doing something overly clever with Groovy. Would need to investigate, assuming there are some steps to reproduce from scratch.