英文:
Conflict between Global Jenkins Java_Home path and local Java_Home path in the remote system
问题
在我的 Jenkins 中,已经将 JAVA_HOME(全局配置)的路径配置为 JAVA_HOME="D:\SRVAPP\jdk1.8.0_162";
在我的远程 PC 上,JAVA_HOME 的路径已配置为 JAVA_HOME="C:\SRVAPP\jdk-11.0.8"(因为在我的远程 PC 上没有 D 盘)。
现在我想在 Jenkins 流水线中将 JAVA_HOME 路径设置为 JAVA_HOME="C:\SRVAPP\jdk-11.0.8",而不是 JAVA_HOME="D:\SRVAPP\jdk1.8.0_162"。
这是否可能?
英文:
In My Jenkins JAVA_HOME(Global Configuration) path has been configured to JAVA_HOME="D:\SRVAPP\jdk1.8.0_162"
In My remote PC JAVA_HOME path has been configured to JAVA_HOME="C:\SRVAPP\jdk-11.0.8" (as i dont have D drive in my remote PC)
Now i want to set the JAVA_Home path to JAVA_HOME="C:\SRVAPP\jdk-11.0.8" instead of JAVA_HOME="D:\SRVAPP\jdk1.8.0_162" in the Jenkins pipeline
Is it possible?
答案1
得分: 1
默认位置通过${JENKINS_URL}/configureTools
设置:
您可以通过${JENKINS_URL}/computer/${NODE}/configure
在每个节点上覆盖该设置:
如果您受到限制,通常可以通过使用env-inject插件在“构建环境”部分注入特定值,或者添加特定步骤来覆盖此设置:
<br>ENV:
然而,您最好的选择可能是使用“全局配置|节点设置”,根据给定的标签应用配置:
英文:
The Default location is set via ${JENKINS_URL}/configureTools
:
You can override that on a per node basis via ${JENKINS_URL}/computer/${NODE}/configure
:
That value is used when selecting the JDK on the job level:
If you are constrained in what you can do, you should generally be able to override this by using the env-inject plugin to inject a specific value, either in the "Build Environment" section or by adding a specific step:
<br>ENV:
However, your best best bet may be to use the "Global Configuration | Slave Setup", based on a given label to apply a configuration:
答案2
得分: 0
每个 Jenkins 节点(也称为 slave 或者你所说的远程节点)都可以定义全局配置工具的位置。
在远程节点上查看配置菜单,并选中“工具位置”复选框。
然后点击“添加”按钮来定义该节点上 Java 的位置。
英文:
Every Jenkins node (aka slave or remote like you call it) can define the locations for the globally configured tools.
See the configure menu of your remote node and check the "Tools Locations" checkbox.
Then click the button "Add" to define the location of your Java on that node.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论