Building a Jenkins plugin

In order to build a Jenkins plugin, you need to run the mvn install command in the plugin directory.

The mvn install command will both build and test the Jenkins plugin and, more importantly, create a file called pluginname.hpi; or, in our case, it will create a file called jenkins-helloworld-example-plugin.hpi in the target directory that we can use to deploy to Jenkins.

I have attached a sample install run in the following screenshot:

Notice that this run finished by installing our Jenkins plugin into several locations, which we will use to install our Jenkins plugin.

Get Hands-On Continuous Integration and Delivery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.