I'm trying to setup a couple of jobs via jenkins-job-dsl v1.20 where i have the following lines:
def existingMavenInstallations = [ "Maven 2.0.11", "Maven 2.2.1", "Maven 3.0.5", "Maven 3.1.0", "Maven 3.1.1" ]
job {
name 'WhatEverName'
jdk (...)
steps {
existingMavenInstallations.each {
maven {
mavenInstallation(it)
goals("-B -Prun-its clean verify")
localRepository(LocalToWorkspace)
}
}
}
}
The problem is that my jobs will be generated with appropriate steps but the maven installation is always "default". The drop-down-box in Jenkins can be selected with the above values and the appropriate Maven versions are installed and available.
So either i'm stumblig over a groovy problem or i misunderstand an other thing ? Any idea?