diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml
index 41707f50024141..ebaab4968c80eb 100644
--- a/hadoop-common-project/hadoop-common/pom.xml
+++ b/hadoop-common-project/hadoop-common/pom.xml
@@ -311,6 +311,11 @@
sshd-core
test
+
+ org.apache.sshd
+ sshd-sftp
+ test
+
org.apache.ftpserver
ftpserver-core
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/sftp/SFTPContract.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/sftp/SFTPContract.java
index f72a2aec862420..631c89586514a0 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/sftp/SFTPContract.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/sftp/SFTPContract.java
@@ -31,12 +31,11 @@
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.contract.AbstractFSContract;
import org.apache.hadoop.fs.sftp.SFTPFileSystem;
-import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.server.SshServer;
-import org.apache.sshd.server.auth.UserAuth;
+import org.apache.sshd.server.auth.UserAuthFactory;
import org.apache.sshd.server.auth.password.UserAuthPasswordFactory;
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
-import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
+import org.apache.sshd.sftp.server.SftpSubsystemFactory;
public class SFTPContract extends AbstractFSContract {
@@ -61,7 +60,7 @@ public void init() throws IOException {
sshd.setPort(0);
sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider());
- List> userAuthFactories = new ArrayList<>();
+ List userAuthFactories = new ArrayList<>();
userAuthFactories.add(new UserAuthPasswordFactory());
sshd.setUserAuthFactories(userAuthFactories);
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java
index e8ba5f211eb8df..dffaabe5778ef0 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/sftp/TestSFTPFileSystem.java
@@ -22,7 +22,7 @@
import java.nio.file.Files;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import org.apache.hadoop.conf.Configuration;
@@ -35,16 +35,13 @@
import org.apache.hadoop.test.GenericTestUtils;
import static org.apache.hadoop.test.PlatformAssumptions.assumeNotWindows;
-import org.apache.sshd.common.NamedFactory;
-import org.apache.sshd.server.Command;
import org.apache.sshd.server.SshServer;
-import org.apache.sshd.server.auth.UserAuth;
+import org.apache.sshd.server.auth.UserAuthFactory;
import org.apache.sshd.server.auth.password.PasswordAuthenticator;
import org.apache.sshd.server.auth.password.UserAuthPasswordFactory;
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider;
import org.apache.sshd.server.session.ServerSession;
-import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;
-
+import org.apache.sshd.server.subsystem.SubsystemFactory;
import org.junit.After;
import org.junit.AfterClass;
@@ -82,8 +79,7 @@ private static void startSshdServer() throws IOException {
sshd.setPort(0);
sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider());
- List> userAuthFactories =
- new ArrayList>();
+ List userAuthFactories = new ArrayList<>();
userAuthFactories.add(new UserAuthPasswordFactory());
sshd.setUserAuthFactories(userAuthFactories);
@@ -100,7 +96,7 @@ public boolean authenticate(String username, String password,
});
sshd.setSubsystemFactories(
- Arrays.>asList(new SftpSubsystemFactory()));
+ Collections.singletonList(new org.apache.sshd.sftp.server.SftpSubsystemFactory()));
sshd.start();
port = sshd.getPort();
diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml
index 2b7798280305d4..7c642b7097580c 100644
--- a/hadoop-project/pom.xml
+++ b/hadoop-project/pom.xml
@@ -198,6 +198,7 @@
1.5.4
2.0
+ 2.10.0
1.7.1
2.2.4
4.13.2
@@ -1163,7 +1164,12 @@
org.apache.sshd
sshd-core
- 2.7.0
+ ${sshd.version}
+
+
+ org.apache.sshd
+ sshd-sftp
+ ${sshd.version}
org.apache.ftpserver