How to compiling and installing a Jenkins plugin from GitHub

61 views
Skip to first unread message

Mark Sinclair

unread,
Dec 2, 2015, 1:37:08 PM12/2/15
to Jenkins Users

I'd like to install a plugin from GitHub, that's not available as a standard Jenkins plug-in.  I can see this requires a hpi file uploaded on the advanced tab in the plug in manager.

The source files I downloaded don't include the hpi, so I assume I need to compile locally to create the hpi then upload it to my Jenkins instance.

We don't have maven or ant installed on our linux machines (hardware team without much software background).  The plug-in tutorial I read shows mvn commands to build the hpi.  Is there a way I can use java to compile the plugin and create the hpi?  What's the quickest way for me to go from a GitHub source directory to a working Jenkins plugin?

Thanks in advance!


Jeff

unread,
Dec 2, 2015, 1:50:29 PM12/2/15
to jenkins...@googlegroups.com
Maven is the quickest way.   Steps below are oversimplified without knowing more detail about the project/plugin.
  1. Install Maven
    1. 'sudo apt-get install maven'
    2. http://apache.mesi.com.ar/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
  2. Clone git repository
    1. git clone <GIT_URL>
  3. Change to project root folder (location of Maven pom.xml file)
    1. cd <PROJECT_FOLDER>
  4. Build it
    1. mvn install
The HPI will likely be somewhere in the <PROJECT_FOLDER>/target/ folder.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/47ab61a9-e892-4bd0-8a9d-04125ba567d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent

Victor Martinez

unread,
Dec 2, 2015, 1:52:13 PM12/2/15
to Jenkins Users
Hi,
 You can read further about hpi generation files via maven: http://jenkinsci.github.io/maven-hpi-plugin/
  In order to run it you need to:
   - Install JDK

 Then you can run 'mvn hpi:run' to test that plugin based on a local jenkins instance, what probably it's worth to give a go before publishing anything in your production environment.

 If you want to create the hpi file then run 'mvn clean package' and
a) copy the resulting ./target/YOURFILE.hpi file to the $JENKINS_HOME/plugins directory. Don't forget to restart Jenkins afterwards.  
b) or use the plugin management console (http://YOURJENKINSURL/pluginManager/advanced) to upload the hpi file. You have to restart Jenkins in order to find the plugin in the installed plugins list.

Cheers

Mark Sinclair

unread,
Dec 2, 2015, 2:05:48 PM12/2/15
to Jenkins Users
Thanks for the responses.  Looks like I have to get maven.  This is the plugin I'm hoping to install:  https://github.com/JoelJ/ez-templates

Victor Martinez

unread,
Dec 2, 2015, 4:01:14 PM12/2/15
to Jenkins Users
BTW, That plugin was already forked (https://groups.google.com/forum/#!topic/jenkinsci-dev/NVLHCFegfYw)
They haven't released anything yet...
Reply all
Reply to author
Forward
0 new messages