jglick/plugin-pom


Parent POM for Jenkins Plugins https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

Download


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"]]
        
        

Readme


plugin-pom

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:

  • Reduced number of overridable properties. All references (e.g. dependencies and plugin versions) not thought to be overridden are no longer based on properties. The main remaining overridable properties are:
    • jenkins.version: The Jenkins version required by the plugin. Current default is 1.625.3
    • jenkins-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.115
    • stapler-plugin.version: The Stapler Maven plugin version required by the plugin. Current default is 1.17
    • java.level: The Java version to use to build the plugin. Current default is 7
    • java.level.test: The Java version to use to build the plugin tests. Current default is 7.
    • In order to make their versions the same as the used core version, slf4jVersion, node.version and npm.version properties are provided.
  • Tests are skipped during the perform phase of a release (can be overridden by setting release.skipTests to false).
  • General clean up.

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:

  • Change the parent POM of your plugin:
  <parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>2.0</version>
  </parent>
  • Override the needed properties, e.g.:
  <properties>
    <jenkins.version>1.609.1</jenkins.version>
    <hpi-plugin.version>1.106</hpi-plugin.version>
  </properties>