Hello,
I am trying to set up a gradle task to run the standalone jar job-dsl-core-1.77-standalone.jar and build config.xml files for my jobs.
I am loading the matrix-auth jenkins plugin onto the classpath but i still get this error suggesting jobdsl doesn't load it correctly:
Caused by: javaposse.jobdsl.dsl.DslScriptException: (Util.groovy, line 6) No signature of method: javaposse.jobdsl.dsl.helpers.properties.FolderPropertiesContext.authorizationMatrixProperty() is applicable for argument types: (dk.nsp.seed.Util$_createFolder_closure1$_closure8$_closure9) values: [dk.nsp.seed.Util$_createFolder_closure1$_closure8$_closure9]
The execption is thrown from this method.
static void createFolder(del, name, suppliers, inherit) {
del.folder(name) {
properties {
authorizationMatrixProperty {
suppliers.each{ supplier ->
permissions(["hudson.model.Item.Read:${supplier}",
"hudson.model.Item.Build:${supplier}",
"hudson.model.Item.Cancel:${supplier}",
"com.cloudbees.plugins.credentials.CredentialsProvider.View:${supplier}"])
}
if (inherit) {
inheritAuthMatrix(getDelegate())
} else {
nonInheritAuthMatrix(getDelegate())
}
}
}
}
}
I would very much appreciate a hint sending me in the right direction to solve this issue, as i don't know how jobdsl injects this extension properly.
This my gradle file just in case. Its pretty basic it just populates deps and calls standalone jar main class.
apply plugin: 'java'
defaultTasks 'libs'
repositories {
maven { url 'http://repo.jenkins-ci.org/releases/' }
jcenter()
}
configurations {
libs
main
}
dependencies {
libs group: 'org.yaml', name: 'snakeyaml', version: '1.17'
main group: 'org.jenkins-ci.plugins', name: 'job-dsl-core', version: '1.77', classifier: 'standalone'
main group: 'org.jenkins-ci.plugins', name: 'matrix-auth', version: '2.0', ext: 'jar'
}
task cleanLibs(type: Delete) {
delete 'libs'
delete 'mains'
}
task runMain (dependsOn: 'libs', type: JavaExec) {
classpath = configurations.libs + configurations.main + files('jobs')
// main = 'javaposse.jobdsl.Run'
main = 'com.simontuffs.onejar.Boot'
args 'jobs/main.groovy'
}
task libs(type: Copy) {
into 'libs'
from configurations.libs
}
task runTest (dependsOn: 'libs', type: JavaExec) {
classpath = configurations.libs + configurations.main + files('jobs')
// main = 'javaposse.jobdsl.Run'
main = 'com.simontuffs.onejar.Boot'
args 'jobs/test.groovy'
}
task mains(type: Copy) {
into 'mains'
from configurations.main
}
/Lars