You need Maven 3 and a JDK 8.0 or later. See the Jenkins wiki for more details.
Set the JAVA HOME variable
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
You can run a Jenkins test instance which loads the plugin automatically by invoking
$ export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n"
$ mvn hpi:run
You can build the plugin hpi file by invoking
$ mvn package
The resulting hpi file in target
can be uploaded to Jenkins through Manage
Jenkins > Manage Plugins > Advanced > Upload Plugin.