Jenkins Development with Gradle

From NovaOrdis Knowledge Base
Revision as of 04:27, 6 April 2021 by Ovidiu (talk | contribs) (→‎build.gradle)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

build.gradle

plugins {
  id 'groovy'
}

repositories {
  maven {
    url "http://repo.jenkins-ci.org/releases"
  }
  mavenCentral()
}

dependencies {
  implementation 'org.codehaus.groovy:groovy-all:3.0.7'
  implementation 'com.cloudbees:groovy-cps:1.31'
  implementation 'org.jenkins-ci.main:jenkins-core:2.121'
}

Jenkins Plugins as Dependencies

The default packaging of Jenkins plugins is jpi, so JARs must be requested explicitly with "@jar" as follows:

dependencies {
 implementation 'org.jenkins-ci.plugins:plain-credentials:1.4@jar'
}