gpt4 book ai didi

java - 如何从 jenkins 的现有项目生成 .hpi 插件

转载 作者:行者123 更新时间:2023-11-29 04:45:11 25 4
gpt4 key购买 nike

我正在尝试使用 jenkins 的性能插件,但最新版本存在一些问题,如链接中所述:

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

评论之一是:“我认为这个问题已经在主干中得到解决,检查并在本地构建似乎可以解决这个问题。我使用的是 Jenkins 版本 1.596.2”

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

这是项目:

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

我已经下载了它并研究了如何导入它。显然这是一个 Maven 项目(因为我知道 Maven 可以创建 .hpi 文件)。但是我无法更多地了解如何实际导入它。我可以尝试不同的教程,但我什至不确定我的方向是否正确。

我的计划是找出如何将其导入为 Maven 项目并研究如何生成 .hpi。我猜这应该可行,如果我弄错了,请告诉我如何继续。

谢谢

更新

我已经能够在本地和 Eclipse 中安装 maven。但是,在两者中我都遇到了一些错误:

[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.

现在,我已经在 J​​AVA_HOME 中设置了 jdk。我不确定我会在这里做错什么。

编辑2

固定编辑 1。我已经能够使用 -mvn 命令成功构建它。但是从 eclipse 我得到错误:

[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。我正在尝试找出解决方法,但到目前为止我还没有任何运气。

最佳答案

tutorial是一个很好的起点

您可以避免使用 IDE 启动并直接运行

mvn install

从您放置源代码的目录。您将需要 maven3、JDK 6.0 作为最低要求并连接到 Internet 以获取您需要的所有 jar 文件。

关于java - 如何从 jenkins 的现有项目生成 .hpi 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37469464/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com