Jenkins Development with Gradle: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Jenkins =Overview=")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=
* [[Jenkins#Subjects|Jenkins]]
* [[Jenkins#Subjects|Jenkins]]
* [[Gradle]]


=Overview=
=Overview=
=build.gradle=
<syntaxhighlight lang='groovy'>
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'
}
</syntaxhighlight>
==Jenkins Plugins as Dependencies==
The default packaging of Jenkins plugins is jpi, so JARs must be requested explicitly with "@jar" as follows:
<syntaxhighlight lang='groovy'>
dependencies {
implementation 'org.jenkins-ci.plugins:plain-credentials:1.4@jar'
}
</syntaxhighlight>

Latest revision as of 04:27, 6 April 2021

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