Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate an .hpi plugin from an existing project for jenkins

I'm trying to use the performance plugin for jenkins, but the latest version has some issues as described in the link:

https://issues.jenkins-ci.org/browse/JENKINS-27100

One of the comments is: "I think this issue have fixed in the trunk, check out and build locally seem to fix the issue. I'm using version Jenkins ver. 1.596.2"

I'm trying to do the same, download the project and build it locally. This is the part that I don't know how to do. I have downloaded eclipse (mars), but I don't even know how to import the project and build it.

This is the project:

https://github.com/jenkinsci/performance-plugin

I have downloaded it and researched on how to import it. Apparently this is a maven project (as I know that maven can create the .hpi files). But I haven't been able to understand more on how to actually import it. I can try different tutorials but I'm not even sure if I'm going on the right direction.

My plan is to figure out how to import it as a maven project and investigate how to generate the .hpi. I'm guessing this should work, if I'm mistaken please let me know how can I proceed.

Thanks

Update

I have been able to to install maven locally and in Eclipse. However, in both I get a couple of errors:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
  C:\Program Files\Java\jre1.8.0_91\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.571 s
[INFO] Finished at: 2016-05-26T17:34:22-05:00
[INFO] Final Memory: 17M/248M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project performance: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre1.8.0_91\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.

Now, I already had the jdk set in JAVA_HOME. I'm not sure what I would be doing wrong here.

EDIT 2

Fixed Edit 1. I've been able to build it successfully with the -mvn command. But from eclipse I get the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project performance: There are test failures.
[ERROR] 
[ERROR] Please refer to E:\eclipseWorkSpace\performance-plugin-master\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]

I can't seem to generate the .hpi as long as the error persists. I'm trying to find out how to solve it, but I haven't had any luck so far.

like image 219
Morgan Soren Avatar asked Mar 12 '23 04:03

Morgan Soren


1 Answers

The tutorial is a good place to start

You can avoid an IDE to start with and just run

mvn install

from the directory you put the source in. You will need maven3, JDK 6.0 as a minimum and a connection to the internet to get all the jar files you will need.

like image 111
KeepCalmAndCarryOn Avatar answered Apr 14 '23 14:04

KeepCalmAndCarryOn