Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.jglick:plugin-pom:plugin-2.0'
}
dependencies {
implementation("com.github.jglick:plugin-pom:plugin-2.0")
}
<dependency>
<groupId>com.github.jglick</groupId>
<artifactId>plugin-pom</artifactId>
<version>plugin-2.0</version>
</dependency>
libraryDependencies += "com.github.jglick" % "plugin-pom" % "plugin-2.0"
:dependencies [[com.github.jglick/plugin-pom "plugin-2.0"]]
Parent POM for Jenkins Plugins
This new parent POM is decoupled from the core Jenkins project, both from the Maven and repository perspectives.
The main changes are:
jenkins.version: The Jenkins version required by the plugin. Current default is 1.625.3jenkins-test-harness.version: The JTH version used to test plugin. The default is 2.0.
Uses split test-harness (see JENKINS-32478).hpi-plugin.version: The HPI Maven Plugin version used by the plugin. Current default is 1.115stapler-plugin.version: The Stapler Maven plugin version required by the plugin. Current default is 1.17java.level: The Java version to use to build the plugin. Current default is 7java.level.test: The Java version to use to build the plugin tests. Current default is 7.slf4jVersion, node.version and npm.version
properties are provided.perform phase of a release (can be overridden by setting release.skipTests to false).Being able to specify the jenkins.version simplifies testing the plugin with different core versions, which is
important, among others, for the Plugin Compatibility Testing.
In order to use the new POM:
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.0</version>
</parent>
<properties>
<jenkins.version>1.609.1</jenkins.version>
<hpi-plugin.version>1.106</hpi-plugin.version>
</properties>