Project

General

Profile

Actions

JenkinsGroovy » History » Revision 9

« Previous | Revision 9/28 (diff) | Next »
Andreas Kohlbecker, 08/15/2013 01:16 PM


Groovy Scripts for Jenkins

You can evaluate groovy scripts in the Jenkins Script Console.

There are several plugins which can be programmed with Groovy:


Get all versions of an artifact from a maven repository

def metadata = new XmlSlurper().parse("http://wp5.e-taxonomy.eu/mavenrepo/eu/etaxonomy/cdm-server/maven-metadata.xml")
metadata.versioning.versions.version.each{
      println "> " + it
}

doc:

the same for the Dynamic Parameter Plug-in which is very nice in conjunction with the *Repository Connector Plugin

def metadata = new XmlSlurper().parse("http://wp5.e-taxonomy.eu/mavenrepo/eu/etaxonomy/cdm-server/maven-metadata.xml")
def list = []
metadata.versioning.versions.version.each{
  list.add(it)
}
return return list.reverse(true)

Updated by Andreas Kohlbecker over 10 years ago · 9 revisions