如何从现有项目为jenkins生成.hpi插件 [英] How to generate an .hpi plugin from an existing project for jenkins

查看:275
本文介绍了如何从现有项目为jenkins生成.hpi插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将性能插件用于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

评论之一是:

我正在尝试做同样的事情,下载项目并在本地构建它.这是我不知道该怎么做的部分.我已经下载了eclipse(火星),但我什至不知道如何导入项目并构建它.

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.

这是项目:

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

我已经下载了它,并研究了如何导入它.显然,这是一个Maven项目(据我所知,Maven可以创建.hpi文件).但是我还无法进一步了解如何实际导入它.我可以尝试其他教程,但是我不确定自己的方向是否正确.

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.

我的计划是弄清楚如何将其作为Maven项目导入,并研究如何生成.hpi.我想这应该可行,如果我弄错了,请告诉我如何进行.

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.

谢谢

我已经能够在本地和Eclipse中安装Maven.但是,在这两种方法中,我都会遇到一些错误:

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.

现在,我已经在JAVA_HOME中设置了jdk.我不确定在这里我会做错什么.

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

固定的编辑1. 我已经可以使用-mvn命令成功构建它.但是从eclipse中我得到了错误:

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]

只要错误仍然存​​在,我似乎就无法生成.hpi.我正在尝试找出解决方法,但是到目前为止我还没有运气.

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.

推荐答案

教程是一个很好的起点

您可以避免IDE开始运行而只是运行

You can avoid an IDE to start with and just run

mvn install

从放置源的目录开始.您将至少需要maven3,JDK 6.0,并且需要连接到Internet才能获取所需的所有jar文件.

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.

这篇关于如何从现有项目为jenkins生成.hpi插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆