Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-51820] Removing Java Web Start support #6543

Merged
merged 13 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,31 +261,6 @@ THE SOFTWARE.
<artifactId>instance-identity</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>launchd-slave-installer</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>slave-installer</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>systemd-slave-installer</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>upstart-slave-installer</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>windows-slave-installer</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
Expand Down
36 changes: 14 additions & 22 deletions core/src/main/java/hudson/slaves/JNLPLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import jenkins.model.Jenkins;
import jenkins.slaves.RemotingWorkDirSettings;
import jenkins.util.SystemProperties;
import jenkins.util.java.JavaUtils;
import jenkins.websocket.WebSockets;
import org.jenkinsci.Symbol;
import org.kohsuke.accmod.Restricted;
Expand Down Expand Up @@ -67,11 +66,10 @@ public class JNLPLauncher extends ComputerLauncher {
public final String tunnel;

/**
* Additional JVM arguments. Can be null.
* @since 1.297
* @deprecated No longer used.
*/
@CheckForNull
public final String vmargs;
@Deprecated
public final transient String vmargs = null;

@NonNull
private RemotingWorkDirSettings workDirSettings = RemotingWorkDirSettings.getEnabledDefaults();
Expand Down Expand Up @@ -103,10 +101,20 @@ public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs, @C
}
}

// TODO cannot easily make tunnel into a @DataBoundSetter because then the @DataBoundConstructor would be on a no-arg constructor
// which is already defined and deprecated. Could retroactively let no-arg constructor use default for workDirSettings,
// which would be a behavioral change only for callers of the Java constructor (unlikely).
@DataBoundConstructor
public JNLPLauncher(@CheckForNull String tunnel) {
this.tunnel = Util.fixEmptyAndTrim(tunnel);
}

/**
* @deprecated use {@link JNLPLauncher#JNLPLauncher(String)}
*/
@Deprecated
public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs) {
this.tunnel = Util.fixEmptyAndTrim(tunnel);
this.vmargs = Util.fixEmptyAndTrim(vmargs);
}

/**
Expand Down Expand Up @@ -249,22 +257,6 @@ public FormValidation doCheckWebSocket(@QueryParameter boolean webSocket, @Query

}

/**
* Returns true if Java Web Start button should be displayed.
* Java Web Start is only supported when the Jenkins server is
* running with Java 8. Earlier Java versions are not supported by Jenkins.
* Later Java versions do not support Java Web Start.
*
* This flag is checked in {@code config.jelly} before displaying the
* Java Web Start button.
* @return {@code true} if Java Web Start button should be displayed.
* @since 2.153
*/
@Restricted(NoExternalUse.class) // Jelly use
public boolean isJavaWebStartSupported() {
return JavaUtils.isRunningWithJava8OrBelow();
}

/**
* Overrides the url that inbound TCP agents should connect to
* as advertised in the agent.jnlp file. If not set, the default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,5 @@ THE SOFTWARE.
<f:entry title="${%Tunnel connection through}" help="/help/system-config/master-slave/jnlp-tunnel.html">
<f:textbox field="tunnel"/>
</f:entry>
<f:entry title="${%JVM options}" field="vmargs">
<f:textbox />
</f:entry>
</f:advanced>
</j:jelly>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

44 changes: 8 additions & 36 deletions core/src/main/resources/hudson/slaves/JNLPLauncher/main.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -33,58 +33,30 @@ THE SOFTWARE.
</j:when>
<j:when test="${it.offline and !it.temporarilyOffline}">
<j:if test="${h.hasPermission(it, it.CONNECT)}">
<p>
${%Connect agent to Jenkins one of these ways:}
</p>
<ul>
<j:if test="${it.launcher.javaWebStartSupported}">
<li>
<p>
<a href="jenkins-agent.jnlp" id="jnlp-link">
<img src="${imagesURL}/webstart.gif" alt="${%launch agent}" />
</a>
${%Launch agent from browser}
</p>
</li>
</j:if>
<j:set var="jenkinsURL" value="${h.inferHudsonURL(request)}"/>
<j:choose>
<j:when test="${it.ACL.hasPermission(app.ANONYMOUS, it.CONNECT)}">
<li>
<p>
${%Run from agent command line:}
</p>
<pre>javaws ${h.inferHudsonURL(request)}${it.url}jenkins-agent.jnlp</pre>
</li>
<li>
<p>
${%Or if the agent is headless:}
</p>
<pre>java${it.launcher.vmargs == null ? '' : ' ' + it.launcher.vmargs} -jar <a href="${rootURL}/jnlpJars/agent.jar">agent.jar</a> -jnlpUrl ${h.inferHudsonURL(request)}${it.url}jenkins-agent.jnlp ${it.launcher.getWorkDirOptions(it)}</pre>
</li>
<pre>curl -so agent.jar ${jenkinsURL}jnlpJars/agent.jar
jglick marked this conversation as resolved.
Show resolved Hide resolved
java -jar <a href="${rootURL}/jnlpJars/agent.jar">agent.jar</a> -jnlpUrl ${jenkinsURL}${it.url}jenkins-agent.jnlp ${it.launcher.getWorkDirOptions(it)}</pre>
</j:when>
<j:otherwise>
<li>
<p>
${%Run from agent command line:}
</p>
<!-- TODO conceal secret w/ JS if possible -->
<pre>java${it.launcher.vmargs == null ? '' : ' ' + it.launcher.vmargs} -jar <a href="${rootURL}/jnlpJars/agent.jar">agent.jar</a> -jnlpUrl ${h.inferHudsonURL(request)}${it.url}jenkins-agent.jnlp -secret ${it.jnlpMac} ${it.launcher.getWorkDirOptions(it)}</pre>
<pre>curl -so agent.jar ${jenkinsURL}jnlpJars/agent.jar
java -jar <a href="${rootURL}/jnlpJars/agent.jar">agent.jar</a> -jnlpUrl ${jenkinsURL}${it.url}jenkins-agent.jnlp -secret ${it.jnlpMac} ${it.launcher.getWorkDirOptions(it)}</pre>
<p>
${%Run from agent command line, with the secret stored in a file:}
${%Or run from agent command line, with the secret stored in a file:}
</p>
<pre>echo ${it.jnlpMac} > secret-file
java${it.launcher.vmargs == null ? '' : ' ' + it.launcher.vmargs} -jar <a href="${rootURL}/jnlpJars/agent.jar">agent.jar</a> -jnlpUrl ${h.inferHudsonURL(request)}${it.url}jenkins-agent.jnlp -secret @secret-file ${it.launcher.getWorkDirOptions(it)}</pre>
</li>
curl -so agent.jar ${jenkinsURL}jnlpJars/agent.jar
java -jar <a href="${rootURL}/jnlpJars/agent.jar">agent.jar</a> -jnlpUrl ${jenkinsURL}${it.url}jenkins-agent.jnlp -secret @secret-file ${it.launcher.getWorkDirOptions(it)}</pre>
</j:otherwise>
</j:choose>
</ul>
<!--
<p>
<a href="custom-jnlp" style="margin-left:3em">
(tweak launch parameters)
</a>
</p>
-->
</j:if>
</j:when>
<j:otherwise>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,11 @@ THE SOFTWARE.
<l:view contentType="application/x-java-jnlp-file">
<j:invokeStatic var="rootURL" className="hudson.slaves.JNLPLauncher" method="getInboundAgentUrl" />

<!--
See https://www.dallaway.com/acad/webstart/ for obtaining the certificate.
-->

<!-- See https://docs.oracle.com/javase/8/docs/technotes/guides/javaws/developersguide/syntax.html for the syntax -->
<jnlp spec="1.0+"
codebase="${rootURL}computer/${h.encode(it.node.nodeName)}/">

<information>
<title>Agent for ${it.displayName}</title>
<vendor>Jenkins project</vendor>
<homepage href="https://jenkins-ci.org/"/>
</information>

<security>
<all-permissions/>
</security>

<!-- JavaWebStart is no longer supported, but a subset of the syntax is retained for compatibility reasons: hudson.remoting.Launcher.parseJnlpArguments -->
<jnlp>
<j:set var="launcher" value="${it.delegatedLauncher}"/>

<resources>
<j:set var="port" value="${request.getParameter('debugPort')}"/>
<j:choose>
<j:when test="${port!=null}">
<j2se version="1.8+" java-vm-args="${launcher.vmargs} -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=${port}" />
</j:when>
<j:otherwise>
<j2se version="1.8+" java-vm-args="${launcher.vmargs}"/>
</j:otherwise>
</j:choose>
<jar href="${rootURL}jnlpJars/remoting.jar"/>
</resources>

<application-desc main-class="hudson.remoting.jnlp.Main">
<application-desc>
<argument>${it.jnlpMac}</argument>
<argument>${it.node.nodeName}</argument>
<j:if test="${launcher.webSocket}">
Expand Down
46 changes: 0 additions & 46 deletions core/src/test/java/jenkins/RemotingJarSignatureTest.java

This file was deleted.

3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ THE SOFTWARE.
<changelog.url>https://www.jenkins.io/changelog</changelog.url>

<!-- Bundled Remoting version -->
<remoting.version>4.13</remoting.version>
<!-- TODO https://github.com/jenkinsci/remoting/pull/532 -->
<remoting.version>4.14-rc3008.3660a_f2a_4925</remoting.version>
timja marked this conversation as resolved.
Show resolved Hide resolved
<!-- Minimum Remoting version, which is tested for API compatibility -->
<remoting.minimum.supported.version>3.14</remoting.minimum.supported.version>

Expand Down
7 changes: 0 additions & 7 deletions test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ THE SOFTWARE.
<version>318.va_f3ccb_729b_71</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- for testing JNLP launch. -->
<groupId>org.jvnet.hudson</groupId>
<artifactId>netx</artifactId>
<version>0.5-hudson-2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
Expand Down
Loading