IntelliJ setup for Jenkins Plugin Development

I decided to write this post since there aren’t many articles describing IntelliJ IDEA setup for Plugin Development in Jenkins. This article walks you through a GUI setup of a minimalist plugin skeleton for Jenkins Plugin Development with Maven.


Note: Versions used in this article:
JDK1.8.0_181, IntelliJ IDEA2018.2, MVN3.3.9

Configure Maven Settings:

Add this following to ~/.m2/settings.xml

    <!-- Give access to Jenkins plugins -->

This will let you use short names for Jenkins Maven plugins (i.e. hpi:create instead of, though this is unnecessary once you are already working in a plugin project (only useful for initial hpi:create).

Generate an empty skeleton plugin

IntelliJ setup:

1) Select File -> New Project

2) Select Maven

3) Check Create from archetype -> Add Archetype


4) Enter the following:

GroupId — io.jenkins.archetypes
ArtifactId — empty-plugin
Version — 1.4


5) Enter a GroupId and ArtifactId for your plugin


6) Select Maven 3 (either Bundled or one you installed)


7) Choose Project name and Project Location


8) Wait for maven to generate POM.xml.


Commandline setup:

To generate an empty plugin, run the following command

mvn archetype:generate -Dfilter=io.jenkins.archetypes:empty-plugin

then follow screen instructions.

To open plugin in IntelliJ:

cd <artifact-id>
idea pom.xml

Add run/debug configuration

IntelliJ Setup

1) Select Add Configuration from the Navigation Bar

2) Select + -> Maven


3) Enter the following configurations:

Name: Maven
Working Directory: /path/to/project
Command line: hpi:run

If you want run your jenkins plugin on a custom port use:

Command line: hpi:run -Djetty.port=8090


Select Apply and OK.

4) Select button to run the Jenkins instance (installs the dependencies upon first run so might take a little time)

Wait until you you see

INFO: Jenkins is fully up and running

5) Log into this URL on your web browser:


You should be able to test your plugin now.

Commandline Setup

To install the plugin and its dependencies:

mvn clean install

After successful installation:

mvn hpi:run

To open plugin in IntelliJ:

cd /path/to/project
idea pom.xml

Select Open Existing Project.

Plugins to aid development:

1) Install Stapler plugin for IntelliJ IDEA

2) Install Jenkins Control Plugin

Example install:

  1. Select File -> Settings
  2. Select Plugins -> Install JetBrains Plugin
  3. Search for keyword: Stapler
  4. Install Stapler plugin for IntelliJ IDEA from the result
  5. Restart IDE