Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
23 changes: 9 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.88</version>
<version>6.2116.v7501b_67dc517</version>
<relativePath />
</parent>

Expand All @@ -15,17 +15,6 @@
<description>Execute shell scripts on remote host using ssh (pre and post build). Based on the cool scp plugin.</description>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>

<developers>
<developer>
<id>edmund_wagner</id>
<name>Edmund Wagner</name>
</developer>
<developer>
<id>ljader</id>
<name>Lukasz Jader</name>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:git@github.com:${gitHubRepo}.git</developerConnection>
Expand All @@ -46,25 +35,31 @@

<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.baseline>2.426</jenkins.baseline>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.516</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<spotless.check.skip>false</spotless.check.skip>
<ban-commons-lang-2.skip>false</ban-commons-lang-2.skip>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>3208.vb_21177d4b_cd9</version>
<version>5888.vd99c2b_38128d</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>commons-lang3-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jsch</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import hudson.model.Descriptor.FormException;
import hudson.model.Item;
import hudson.security.ACL;
import hudson.util.StreamTaskListener;
Expand Down Expand Up @@ -139,7 +140,7 @@ private Session createSession(final PrintStream logger) throws JSchException, IO
* Returns the same instance when supplied with CredentialsSSHSite
*/
public static CredentialsSSHSite migrateToCredentials(CredentialsSSHSite site)
throws InterruptedException, IOException {
throws InterruptedException, IOException, FormException {
if (!(site instanceof LegacySSHSite)) {
return site;
}
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/org/jvnet/hudson/plugins/SSHBuildWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jenkinsci.plugins.jsch.JSchConnector;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

public final class SSHBuildWrapper extends BuildWrapper {

Expand Down Expand Up @@ -217,7 +217,7 @@
@SuppressFBWarnings(
value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Javadoc promises req is always non-null")
public BuildWrapper newInstance(StaplerRequest req, JSONObject formData) {
public BuildWrapper newInstance(StaplerRequest2 req, JSONObject formData) {
return req.bindJSON(clazz, formData);
}

Expand All @@ -240,7 +240,7 @@
}

@Override
public boolean configure(StaplerRequest req, JSONObject formData) {
public boolean configure(StaplerRequest2 req, JSONObject formData) {
List<CredentialsSSHSite> sitesFromRequest =
req.bindJSONToList(CredentialsSSHSite.class, formData.get("sites"));
for (Iterator<?> iter = sitesFromRequest.iterator(); iter.hasNext(); ) {
Expand Down Expand Up @@ -328,9 +328,7 @@
migratedCredentials.add(migrated);

madeChanges = madeChanges || (migrated != site);
} catch (InterruptedException e) {
throw new IllegalStateException("Failed to migrate site: " + site, e);
} catch (IOException e) {
} catch (InterruptedException | IOException | FormException e) {

Check warning on line 331 in src/main/java/org/jvnet/hudson/plugins/SSHBuildWrapper.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 331 is not covered by tests
throw new IllegalStateException("Failed to migrate site: " + site, e);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jvnet/hudson/plugins/SSHBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

public class SSHBuilder extends Builder {

Expand Down Expand Up @@ -129,7 +129,7 @@ public String getDisplayName() {
}

@Override
public Builder newInstance(StaplerRequest req, JSONObject formData)
public Builder newInstance(StaplerRequest2 req, JSONObject formData)
throws hudson.model.Descriptor.FormException {
return req.bindJSON(clazz, formData);
}
Expand Down
Loading