Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
5ca78f3
Update baseline to 2.282, fixes PCT (detached ssh plugin) (#215)
timja Mar 12, 2021
e5553ea
Bump plugin from 4.15 to 4.16 (#213)
dependabot[bot] Mar 12, 2021
3d24736
Bump plugin from 4.16 to 4.17 (#216)
dependabot[bot] Mar 12, 2021
57d42b9
[maven-release-plugin] prepare release ssh-slaves-1.31.6
kuisathaverat Mar 13, 2021
81e7bc4
[maven-release-plugin] prepare for next development iteration
kuisathaverat Mar 13, 2021
79ba029
test: add SSH connections test for several configurations (#206)
kuisathaverat Mar 19, 2021
c51daff
[JENKINS-65155] The "java is not in the path" warning is show even th…
kuisathaverat Apr 9, 2021
aabe3c1
Bump testcontainers from 1.15.1 to 1.15.2 (#219)
dependabot[bot] Apr 9, 2021
59a6953
[maven-release-plugin] prepare release ssh-slaves-1.31.7
kuisathaverat Apr 9, 2021
d028f37
[maven-release-plugin] prepare for next development iteration
kuisathaverat Apr 9, 2021
4fdae33
Bump testcontainers from 1.15.2 to 1.15.3 (#225)
dependabot[bot] May 1, 2021
5a77c8f
Bump bom-2.277.x from 26 to 28 (#224)
dependabot[bot] May 1, 2021
c3d1bbb
Bump plugin from 4.17 to 4.18 (#223)
dependabot[bot] May 1, 2021
332a6b2
improve error message for Java missing on agent (#222)
peterbecich May 1, 2021
0d620bd
Bump docker-fixtures from 1.10 to 1.11 (#221)
dependabot[bot] May 1, 2021
c9602cd
[JENKINS-65398] Terminology update (#226)
twasyl May 4, 2021
5648f3e
Bump bom-2.277.x from 28 to 29 (#227)
dependabot[bot] May 4, 2021
ebb3160
Bump bom-2.277.x from 29 to 807.v6d348e44c987 (#229)
dependabot[bot] May 15, 2021
b883c7e
Replace usages of `com.google.common.io.ByteStreams` with usages of `…
basil May 15, 2021
bba7096
chore: bump version to 1.32.0
kuisathaverat Jun 5, 2021
918d0f6
[maven-release-plugin] prepare release ssh-slaves-1.32.0
kuisathaverat Jun 5, 2021
38ad3f6
[maven-release-plugin] prepare for next development iteration
kuisathaverat Jun 5, 2021
22f2e08
Bump plugin from 4.18 to 4.19 (#231)
dependabot[bot] Jun 6, 2021
34d997c
Bump bom-2.277.x from 807.v6d348e44c987 to 887.vae9c8ac09ff7 (#235)
dependabot[bot] Jul 2, 2021
1efd677
[JENKINS-65929] Detection of docker is unreliable (#236)
kuisathaverat Jul 2, 2021
24c2d1e
Bump git-changelist-maven-extension from 1.0-beta-7 to 1.2 (#237)
dependabot[bot] Jul 11, 2021
eed7f2a
Bump plugin from 4.19 to 4.20 (#239)
dependabot[bot] Jul 24, 2021
8ab9baa
Bump sshd from 3.0.3 to 3.0.4 (#238)
dependabot[bot] Jul 24, 2021
506b868
update package name for CommandFactory for mina-sshd 2.5.1 (#247)
Aug 20, 2021
ba1d657
Bump plugin from 4.20 to 4.24 (#244)
dependabot[bot] Aug 22, 2021
d03bc5d
Bump bom-2.277.x from 887.vae9c8ac09ff7 to 924.vda78166e6655 (#246)
dependabot[bot] Aug 22, 2021
8c2bfbe
fix: use user and password intead of DSA key in the test (#248)
kuisathaverat Aug 23, 2021
6009893
Bump testcontainers from 1.15.3 to 1.16.0 (#240)
dependabot[bot] Aug 23, 2021
a48f960
chore: bump Jenkins core to 1.289.1 LTS version (#250)
kuisathaverat Aug 25, 2021
22f5f5f
Bump sshd from 3.0.4 to 3.1.0 (#242)
dependabot[bot] Aug 25, 2021
99113ff
[maven-release-plugin] prepare release ssh-slaves-1.33.0
kuisathaverat Aug 25, 2021
21b694b
[maven-release-plugin] prepare for next development iteration
kuisathaverat Aug 25, 2021
8708c63
Bump bom-2.277.x from 924.vda78166e6655 to 937.v51fde92016ed (#251)
dependabot[bot] Sep 1, 2021
4b3a02a
[JENKINS-42969] Use Computer.addAction() (#261)
offa Nov 6, 2021
d86f588
[JENKINS-66601] host key allows ed25519 & ecdsa (#256)
MarkEWaite Nov 6, 2021
b52701e
Updated Readme ## Notes linkname to 1.31 (#252)
thommelutten Nov 6, 2021
affacf5
Bump bom-2.277.x from 937.v51fde92016ed to 961.vf0c9f6f59827 (#258)
dependabot[bot] Nov 6, 2021
7b02af1
Bump plugin from 4.24 to 4.29 (#262)
dependabot[bot] Nov 6, 2021
3045a3c
Add missing nullability annotations and replace JSR 305 (#260)
offa Nov 6, 2021
1dff6b3
Bump plugin from 4.29 to 4.31 (#264)
dependabot[bot] Nov 9, 2021
22bdd5d
Bump testcontainers from 1.16.0 to 1.16.2 (#263)
dependabot[bot] Nov 15, 2021
964c603
Bump git-changelist-maven-extension from 1.2 to 1.3
dependabot[bot] Jan 3, 2022
bc4dc04
Bump plugin from 4.31 to 4.33 (#267)
dependabot[bot] Jan 21, 2022
36c379a
Create jenkins-security-scan.yml
kuisathaverat Feb 26, 2022
e0fde81
Bump testcontainers from 1.16.2 to 1.16.3 (#268)
dependabot[bot] Feb 26, 2022
ecacc09
Replace assertion and use lambda (#270)
offa Feb 26, 2022
2eb3710
Bump plugin from 4.33 to 4.35 (#272)
dependabot[bot] Feb 26, 2022
f3105af
Update jenkins-security-scan.yml
kuisathaverat Feb 26, 2022
4f02481
feat: enable continouos delivery (#269)
kuisathaverat Mar 1, 2022
726b4e1
Bump actions/checkout from 2.3.4 to 2.4.0 (#276)
dependabot[bot] Mar 1, 2022
f245b0d
Changes monitor category (#274)
alecharp Mar 1, 2022
66beec1
Bump plugin from 4.35 to 4.37 (#275)
dependabot[bot] Mar 1, 2022
ba0d6a2
Bump actions/checkout from 2.4.0 to 3 (#277)
dependabot[bot] Mar 3, 2022
2253ced
chore: change the version number format (#278)
kuisathaverat Mar 5, 2022
80a9538
chore: test most common SSH connections (#279)
kuisathaverat Mar 7, 2022
2d29533
Bump plugin from 4.37 to 4.40 (#282)
dependabot[bot] Apr 8, 2022
1083ce3
chore: update Jenkins Core to 2.319 (#284)
kuisathaverat Apr 8, 2022
fad54aa
Bump actions/setup-java from 2 to 3 (#285)
dependabot[bot] Apr 11, 2022
ab864a8
Bump sshd from 3.1.0 to 3.228.v4c9f9e652c86 (#287)
dependabot[bot] Apr 20, 2022
b9e346e
Bump bom-2.319.x from 1246.va_b_50630c1d19 to 1280.vd669827e38cd (#290)
dependabot[bot] Apr 20, 2022
ffaccaa
Bump testcontainers from 1.16.3 to 1.17.1 (#289)
dependabot[bot] Apr 21, 2022
c82988f
Bump bom-2.319.x from 1280.vd669827e38cd to 1289.v5c4b_1c43511b_ (#291)
dependabot[bot] Apr 25, 2022
dcc8631
Bump bom-2.319.x from 1289.v5c4b_1c43511b_ to 1342.v729ca_3818e88 (#293)
dependabot[bot] Apr 29, 2022
2d13263
Bump jenkins-infra/jenkins-maven-cd-action from 1.2.0 to 1.3.0 (#296)
dependabot[bot] May 9, 2022
796376b
Update information for Windows OpenSSH agents (#294)
slide May 9, 2022
87a762f
Bump jenkins-infra/interesting-category-action from 1.0.0 to 1.1.0 (#…
dependabot[bot] May 10, 2022
1c7698d
Bump sshd from 3.228.v4c9f9e652c86 to 3.236.ved5e1b_cb_50b_2 (#300)
dependabot[bot] May 20, 2022
e0badc9
Bump sshd from 3.236.ved5e1b_cb_50b_2 to 3.237.v883d165a_c1d3 (#302)
dependabot[bot] May 23, 2022
d834f8a
Fix deadlock when afterDisconnect is called during launch() (#304)
tomekjarosik Jun 13, 2022
2e09e60
Bump jenkins-infra/interesting-category-action from 1.1.0 to 1.2.0 (#…
dependabot[bot] Jun 14, 2022
ee139c0
chore: use jenkins infra maven cd reusable workflow (#308)
jetersen Jun 15, 2022
2e6629b
Bump testcontainers from 1.17.1 to 1.17.2 (#301)
dependabot[bot] Jun 15, 2022
a64c6e4
Bump bom-2.319.x from 1342.v729ca_3818e88 to 1409.v7659b_c072f18 (#303)
dependabot[bot] Jun 15, 2022
5b080b6
Bump sshd from 3.237.v883d165a_c1d3 to 3.242.va_db_9da_b_26a_c3
dependabot[bot] Jun 20, 2022
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
6 changes: 5 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"
- package-ecosystem: "github-actions"
directory: /
schedule:
interval: "daily"
6 changes: 2 additions & 4 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc
# https://www.jenkins.io/doc/developer/publishing/releasing-cd/#release-notes
_extends: .github
# Semantic versioning is used d=for this plugin: https://semver.org/
version-template: $MAJOR.$MINOR.$PATCH
tag-template: ssh-slaves-$NEXT_PATCH_VERSION
name-template: $NEXT_PATCH_VERSION

15 changes: 15 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins

name: cd
on:
workflow_dispatch:
check_run:
types:
- completed

jobs:
maven-cd:
uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1
secrets:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/jenkins-security-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Jenkins Security Scan
on:
push:
branches:
- main
# see https://github.com/jenkins-infra/jenkins-security-scan/issues/3
# pull_request:
# types: [ opened, synchronize, reopened ]
workflow_dispatch:

jobs:
security-scan:
uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v1
with:
java-cache: '' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate.
java-version: 11 # What version of Java to set up for the build.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ target
.settings
work
bin
.DS_Store
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-beta-7</version>
<version>1.3</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
-Dchangelist.format=%d.v%s
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def buildConfiguration = [
[platform: 'linux', jdk: '11'],
]

buildPlugin(configurations: buildConfiguration)
buildPlugin(configurations: buildConfiguration, timeout: 90)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Provides a means to launch agents via SSH.
## Notes

This plugin is formerly known as "SSH Slaves Plugin".
It was renamed in [1.32.0](https://github.com/jenkinsci/ssh-slaves-plugin/releases/tag/ssh-slaves-1.31.0), but the plugin ID was retained as `ssh-slaves` to retain compatibility for the plugin users.
It was renamed in [1.31.0](https://github.com/jenkinsci/ssh-slaves-plugin/releases/tag/ssh-slaves-1.31.0), but the plugin ID was retained as `ssh-slaves` to retain compatibility for the plugin users.
11 changes: 7 additions & 4 deletions doc/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This means that **you have to install a JDK/JRE 8 on your agent** in order to ru

The agent should have **enough memory** to run the remoting process and the builds.

**The agent needs to be reachable from the master**,
**The agent needs to be reachable from the Jenkins controller**,
You have to be ensure that your Jenkins instance can connect through SSH port to your agent; you can check it from the command line.
You will have to supply an account that can log in on the target machine. No root privileges are required.

Expand Down Expand Up @@ -106,7 +106,7 @@ to see if an entry exists that matches the current connection. It is possible to
the Java property `-Dhudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy.known_hosts_file=PATH_TO_FILE`

This method does not make any updates to the Known Hosts file, instead using the file as a read-only source and expecting
someone with suitable access to the appropriate user account on the Jenkins master to update the file as required,
someone with suitable access to the appropriate user account on the Jenkins controller to update the file as required,
potentially using the ssh hostname command to initiate a connection and update the file appropriately.

#### Manually provided key Verification Strategy
Expand All @@ -116,7 +116,7 @@ potentially using the ssh hostname command to initiate a connection and update t
Checks the key provided by the remote host matches the key set by the user who configured this connection.

The SSH key expected for this connection. This key should be in the form `algorithm value`
where algorithm is one of ssh-rsa or ssh-dss, and value is the Base 64 encoded content of the key. The keys should be placed in /etc/ssh/<key_name>.pub
where `algorithm` is one of ssh-rsa, ssh-ed25519, or ecdsa-sha2-nistp256, and `value` is the base 64 encoded content of the key. The public keys for a Linux agent can be read from the agent file system at `/etc/ssh/<key_name>.pub`.

#### Manually trusted key Verification Strategy

Expand Down Expand Up @@ -226,13 +226,16 @@ See [SSH Build Agents and Cygwin](https://wiki.jenkins.io/display/JENKINS/SSH+sl

### Launch Windows agents using Microsoft OpenSSH

The current version of the plugin does not run directly on PowerShell, you have to use prefix and suffix settings to trick the command and make it works, Windows 10 machines can run as SSH agents with the Microsoft OpenSSH server by using:
The current version of the plugin does not run when Powershell is the default shell for the agent system. To connect to the agent you have to use prefix and suffix settings to trick the command and make it work, Windows 10/11 machines can run as SSH agents with the Microsoft OpenSSH server by using:

**Prefix Start Agent Command**

```
powershell -Command "cd C:\J\S ; C:\J\S\jdk\bin\java.exe -jar remoting.jar" ; exit 0 ; rem '
```

`C:\J\S` is the path to the agent work directory on the agent system. If java is in a different directory, you will need to specify that directory instead of `C:\J\S\jdk\bin`.

**Suffix Start Agent Command**

```
Expand Down
9 changes: 5 additions & 4 deletions doc/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ and see [Logging_and_Troubleshooting](https://en.wikibooks.org/wiki/OpenSSH/Logg

### Threads stuck at CredentialsProvider.trackAll

If you detect an adnormal number of threads and the thread dump showed a thread for each offline agent stuck waiting for a lock like this:
If you detect an abnormal number of threads and the thread dump showed a thread for each offline agent stuck waiting for a lock like this:

```
at hudson.XmlFile.write(XmlFile.java:186)
Expand Down Expand Up @@ -140,7 +140,7 @@ java.lang.NoClassDefFoundError: com/trilead/ssh2/Connection

### After upgrade to ssh-slaves 1.28+ Failed to connect using SSH key credentials from files

The SSH Build Agents Plugin version newer than 1.28 uses ssh-credentials 1.14, this versions deprecated the use of "From the Jenkins master ~/.ssh", and "From a file on Jenkins master" SSH credential types because [SECURITY-440](https://jenkins.io/security/advisory/2018-06-25/#SECURITY-440), the ssh-credentials plugins should migrate these deprecated credentials to "Enter directly" type on restart but seems there are some cases that it fails or it is not possible.
The SSH Build Agents Plugin version newer than 1.28 uses ssh-credentials 1.14, this versions deprecated the use of "From the Jenkins controller ~/.ssh", and "From a file on Jenkins controller" SSH credential types because [SECURITY-440](https://jenkins.io/security/advisory/2018-06-25/#SECURITY-440), the ssh-credentials plugins should migrate these deprecated credentials to "Enter directly" type on restart but seems there are some cases that it fails or it is not possible.

The issue is related to ssh-credentials and a deprecated type of credentials, the workaround it is to recreate the credential with the same ID using "Enter directly" for the key, probably if you only save again the credential it will be migrated.

Expand All @@ -166,7 +166,8 @@ ConversionException: Could not call com.cloudbees.jenkins.plugins.sshcredentials

### Selenium Grid agents failed to connect

On recent versions of Jenkins Core, [Agent - Master Access Control](https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control) was introduced it seems causes an issue with Selenium Grid Agents, to fix this problem you have to disable: "Manage Jenkins" > "Configure Global Security", and check "Enable Agent → Master Access Control" (as it's said in Jenkin documentation)
On Jenkins Core 2.89.3, [Agent - Controller Access Control](https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control) was introduced it can causes an issue with Selenium Grid Agents, to fix this problem you have to disable: "Manage Jenkins" > "Configure Global Security", and check "Enable Agent → Controller Access Control" (as it's said in Jenkins documentation)
you can see more details at [JENKINS-49118](https://issues.jenkins.io/browse/JENKINS-49118)
https://wiki.jenkins.io/display/JENKINS/Slave+To+Master+Access+Control

"On the other hand, if all your agents are trusted to the same degree as your master, then it is safe to leave this subsystem off"
Expand Down Expand Up @@ -194,7 +195,7 @@ Caused by: java.io.EOFException

### Corrupt agent workdir folder

If you experience a immmediate disconnection without any clear trace it could be related with a corrupt file in the agent workdir folder.
If you experience an immediate disconnection without any clear trace it could be related with a corrupt file in the agent workdir folder.

```
Apr 17, 2019 2:16:23 PM INFO hudson.remoting.SynchronousCommandTransport$ReaderThread run
Expand Down
58 changes: 31 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.15</version>
<version>4.40</version>
</parent>

<artifactId>ssh-slaves</artifactId>
<version>${revision}${changelist}</version>
<version>${revision}.${changelist}</version>
<packaging>hpi</packaging>

<name>SSH Build Agents plugin</name>
Expand All @@ -25,11 +25,11 @@
</licenses>

<properties>
<revision>1.31.6</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.222.4</jenkins.version>
<revision>1</revision>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.319.1</jenkins.version>
<java.level>8</java.level>
<configuration-as-code.version>1.46</configuration-as-code.version>
<hpi.compatibleSinceVersion>1.31.0</hpi.compatibleSinceVersion>
</properties>

<developers>
Expand Down Expand Up @@ -102,8 +102,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.204.x</artifactId>
<version>18</version>
<artifactId>bom-2.319.x</artifactId>
<version>1409.v7659b_c072f18</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -118,22 +118,25 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>trilead-api</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>2.3.14</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>sshd</artifactId>
<version>3.242.va_db_9da_b_26a_c3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.test</groupId>
<artifactId>docker-fixtures</artifactId>
<version>1.10</version>
<version>1.11</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -145,27 +148,28 @@
<dependency>
<groupId>io.jenkins</groupId>
<artifactId>configuration-as-code</artifactId>
<version>${configuration-as-code.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.configuration-as-code</groupId>
<artifactId>test-harness</artifactId>
<version>${configuration-as-code.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.17.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<minimumJavaVersion>1.8</minimumJavaVersion>
<compatibleSinceVersion>1.31.0</compatibleSinceVersion>
</configuration>
</plugin>
</plugins>
</build>
</project>
12 changes: 6 additions & 6 deletions src/main/java/hudson/plugins/sshslaves/JavaProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package hudson.plugins.sshslaves;

import com.trilead.ssh2.Connection;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.slaves.SlaveComputer;
Expand All @@ -32,13 +33,12 @@

import java.util.List;
import java.util.Collections;
import javax.annotation.Nonnull;

/**
* Guess where Java is.
*/
public abstract class JavaProvider implements ExtensionPoint {

private static final VersionNumber JAVA_LEVEL_8 = new VersionNumber("8");

/**
Expand Down Expand Up @@ -68,12 +68,12 @@ public static ExtensionList<JavaProvider> all() {

/**
* Gets minimal required Java version.
*
* @return Minimal Java version required on the master and agent side.
*
* @return Minimal Java version required on the controller and agent side.
* @since TODO
*
*
*/
@Nonnull
@NonNull
public static VersionNumber getMinJavaLevel() {
return JAVA_LEVEL_8;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import hudson.slaves.SlaveComputer;
import hudson.util.VersionNumber;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.WARNING;

/**
* class to check if the version of java installed on the agent is a supported one.
Expand Down Expand Up @@ -76,17 +75,12 @@ protected String resolveJava() throws InterruptedException, IOException {
try {
return checkJavaVersion(listener, javaCommand);
} catch (IOException e) {
if(!"java".equalsIgnoreCase(javaCommand)){
LOGGER.log(WARNING, "Java is not in the PATH nor configured with the javaPath setting,"
+ " Jenkins will try to guess where is Java,"
+ "this guess will be remove in the future.");
}
LOGGER.log(FINE, "Failed to check the Java version",e);
// try the next one
}
}
}
throw new IOException("Java not found on " + computer + ". Install a Java 8 version on the Agent.");
throw new IOException("Java not found on " + computer + ". Install Java 8 or Java 11 on the Agent.");
}

@NonNull
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/sshslaves/SSHConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
import com.cloudbees.plugins.credentials.common.StandardUsernameListBoxModel;
import com.trilead.ssh2.Connection;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.ItemGroup;
import hudson.model.TaskListener;
Expand Down Expand Up @@ -167,7 +168,7 @@ public SSHConnector(int port, String credentialsId, String jvmOptions, String ja
}

@Override
public SSHLauncher launch(String host, TaskListener listener) {
public SSHLauncher launch(@NonNull String host, TaskListener listener) {
SSHLauncher sshLauncher = new SSHLauncher(host, port, credentialsId, jvmOptions, javaPath, prefixStartSlaveCmd,
suffixStartSlaveCmd, launchTimeoutSeconds, maxNumRetries, retryWaitTime, sshHostKeyVerificationStrategy);
sshLauncher.setWorkDir(workDir);
Expand Down Expand Up @@ -283,6 +284,7 @@ public Boolean getTcpNoDelay() {

@Extension
public static class DescriptorImpl extends ComputerConnectorDescriptor {
@NonNull
@Override
public String getDisplayName() {
return Messages.SSHLauncher_DescriptorDisplayName();
Expand Down
Loading