正如标题已经指出的那样,JNLP 连接已被弃用, Jenkins 还提供了一条消息和一个超链接到
https://en.wikipedia.org/wiki/Java_Web_Start#Deprecation
那么现在推荐的将 Windows Slave 附加到 Jenkins 的方法是什么,在 https://jenkins.io 上似乎没有真正好的指南涵盖该主题。
最佳答案
开源替代品
有一个名为 OpenWebStart 的开源替代品。这是基于 IcedTeaWeb .
更多信息:Java Web Start is dead - long live OpenWebStart!
OpenWebStart is an open source implementation of the WebStart and JNLP standards (JSR-56).
[...]
In IcedTeaWeb we are currently working on mapping the JNLP spec and supporting its functions to the greatest extent possible. In addition to OpenWebStart, which uses IcedTeaWeb as its core, IcedTeaWeb is also used within AdoptOpenJDK to provide minimal WebStart in the Java 8 releases of AdoptOpenJDK. However, these are limited compared to OpenWebStart because they can only use the current JVM to run JNLP-based applications.
使用命令行安装 Jenkins 服务摆脱 Java Web Start
使用
jenkins-slave.exe
从命令行安装 Jenkins 服务时(又名 winsw-*.exe
),不再需要 Java Web Start。看来 JNLP 协议(protocol)仍在幕后使用,因此将来可能仍存在一些弃用问题。步骤 (假设您已经在 Jenkins master 中设置了节点):
将其放在自定义 WorkDir 路径中,并将其重命名为“jenkins-slave.exe”
http://YourJenkinsServer:8080/jnlpJars/agent.jar
将其放在自定义 WorkDir 路径中,并将其重命名为“slave.jar”<service>
<id>YourJenkinsSlaveServiceId</id>
<name>Your Jenkins Slave Service Name</name>
<description>This service runs an agent for Jenkins automation server.</description>
<executable>C:\Program Files\Java\JRE8\bin\java.exe</executable>
<arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl http://YourJenkinsServer:8080/computer/YourNodeName/slave-agent.jnlp -secret YourSecretStringConsistingOfHexadecimalCharacters -workDir=C:\YourNodeWorkDir</arguments>
<logmode>rotate</logmode>
<onfailure action="restart" />
<download from="http://YourJenkinsServer:8080/jnlpJars/agent.jar" to="%BASE%\slave.jar"/>
<extensions>
<extension enabled="true" className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension" id="killOnStartup">
<pidfile>%BASE%\jenkins_agent.pid</pidfile>
<stopTimeout>5000</stopTimeout>
<stopParentFirst>false</stopParentFirst>
</extension>
</extensions>
</service>
http://YourJenkinsServer:8080/computer/YourNodeName/
)。Official documentation
<configuration>
<startup>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
jenkins-slave.exe install
sc start YourJenkinsSlaveServiceId
关于windows - JNLP 连接在 Jenkins 中已被弃用 将 Windows 从属连接到 Jenkins 的新推荐方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60372214/