gradle-jenkins-plugin icon indicating copy to clipboard operation
gradle-jenkins-plugin copied to clipboard

getJenkinsVersion() always returns null

Open ywelsch opened this issue 9 years ago • 2 comments

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') }

ywelsch avatar May 27 '15 15:05 ywelsch

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 avatar Jun 08 '15 10:06 bikusta

@bikusta you can put that directly before the archiveArtifacts block.

jobManagement.metaClass.getJenkinsVersion = { new hudson.util.VersionNumber('1.592') }
archiveArtifacts {
    pattern 'some/file'
}

ywelsch avatar Jun 10 '15 09:06 ywelsch