-
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.
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.