gradle-jenkins-plugin
gradle-jenkins-plugin copied to clipboard
getJenkinsVersion() always returns null
see MapJobManagement.
The job-dsl-plugin seems to require a properly set jenkins version in newer versions of the plugin. For example, the archiveArtifacts block requires this to evaluate properly (see https://github.com/jenkinsci/job-dsl-plugin/blob/ac9244d256ed7b856fb3b044ceab169b32662f85/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContext.groovy )
It would be nice to make the Jenkins version number configurable on the Gradle Jenkins Plugin. A new task to check if configured an actual versions match could also be helpful.
For now, I hacked around the issue with...
jobManagement.metaClass.getJenkinsVersion = { new hudson.util.VersionNumber('1.592') }
Hi @ywelsch,
I'm running into the same issue with the archiveArtifacts block and the missing version number. Where exactly did you put your workaround? Into the build script? At which position?
Thanks!
PS: I'm new to the Gradle and Groovy world.
@bikusta you can put that directly before the archiveArtifacts block.
jobManagement.metaClass.getJenkinsVersion = { new hudson.util.VersionNumber('1.592') }
archiveArtifacts {
pattern 'some/file'
}