Fork me on GitHub

Plugin Documentation

This report describes goals, parameters details, requirements and sample usage of this plugin.

Goals

Goals available for this plugin:

Goal Description
hpi:assemble-dependencies Used to assemble transitive dependencies of plugins into one location.

Unlike other similar mojos in this plugin, this one traverses dependencies through its graph.

hpi:custom-war Builds a custom Jenkins war that includes all the additional plugins referenced in this POM.
hpi:generate-taglib-interface Generates the strongly-typed Java interfaces for Groovy taglibs.
hpi:help Display help information on maven-hpi-plugin.
Call mvn hpi:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
hpi:hpi Build a war/webapp.
hpi:hpl Generate .hpl file.
hpi:insert-test Insert default test suite.
hpi:jar Build a jar separate from the hpi goal. If you do not use this goal then the HpiMojo will generate a jar file anyway. Using this goal it is possible to customize the jar file that is built, e.g. shading dependencies, code signing, etc
hpi:list-plugin-dependencies List up all plugin dependencies declared in the project. Transitive plugin dependencies will not be listed.
hpi:record-core-location Keeps track of where core was built from, so plugins depending on a snapshot version of core can pick up changes without reload.
hpi:resolve-test-dependencies Places test-dependency plugins into somewhere the test harness can pick up.

See TestPluginManager.loadBundledPlugins() where the test harness uses it.

Additionally, it may adjust the classpath for surefire:test to run tests against different versions of various dependencies than what was configured in the POM.

hpi:run Runs Jenkins with the current plugin project.

This only needs the source files to be compiled, so run in the compile phase.

To specify the HTTP port, use -Djetty.port=PORT

hpi:test-hpl Generate .hpl file in the test class directory so that test harness can locate the plugin.
hpi:test-runtime Configure Surefire for the desired version of Java.
hpi:validate Make sure that we are running in the right environment.
hpi:validate-hpi Validates dependencies depend on older or equal core than the current plugin.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.9.6
JDK 17

System Requirements History

The following specifies the minimum requirements to run this Maven plugin for historical versions:

Plugin Version Maven JDK
from 3.59-rc1631.a_5f524a_6db_b_8 to 3.61-rc1669.53c1ef676c62 3.9.6 -
from 3.39-rc1370.de4c8fa_60209 to 3.59-rc1630.c274619d735f 3.8.1 -
from 3.21 to 3.39-rc1370.a_27f3c0012c1 - -
from 2.0 to 3.20 - 8
from 1.117 to 1.122 - 7
from 1.115 to 1.116 - 6
1.114-cloudbees-1 - 5
1.114 - 6
from 1.105 to 1.113 - 5
from 1.103 to 1.104 - 6
from 1.61 to 1.102 - 5

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.jenkins-ci.tools</groupId>
          <artifactId>maven-hpi-plugin</artifactId>
          <version>3.61-SNAPSHOT</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.jenkins-ci.tools</groupId>
        <artifactId>maven-hpi-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"