diff --git a/build/build.properties b/build/build.properties index d38dd09ee..4bb757e66 100644 --- a/build/build.properties +++ b/build/build.properties @@ -26,7 +26,7 @@ runwar.version=5.1.1 # Need to log a ticket with JLine to fix this jline.version=3.21.0 jansi.version=2.4.1 -// TODO: There is a 6.x version of JGit, but I think it's not compat with Java 8 +# TODO: There is a 6.x version of JGit, but I think it's not compat with Java 8 jgit.version=5.13.3.202401111512-r json-smart-mini.version=1.3.2 diff --git a/build/build.xml b/build/build.xml index af91cc51a..a4ff4792f 100644 --- a/build/build.xml +++ b/build/build.xml @@ -1028,13 +1028,13 @@ External Dependencies: - - - - - - - + + + + + + + diff --git a/src/java/com/ortussolutions/commandbox/jgit/GenericSessionFactory.java b/src/java/com/ortussolutions/commandbox/jgit/GenericSessionFactory.java index 0f4e096ff..feee1aa39 100644 --- a/src/java/com/ortussolutions/commandbox/jgit/GenericSessionFactory.java +++ b/src/java/com/ortussolutions/commandbox/jgit/GenericSessionFactory.java @@ -9,19 +9,17 @@ */ package com.ortussolutions.commandbox.jgit; -import org.eclipse.jgit.transport.JschConfigSessionFactory; -import org.eclipse.jgit.transport.OpenSshConfig; -import com.jcraft.jsch.Session; +import org.eclipse.jgit.transport.sshd.SshdSessionFactory; -public class GenericSessionFactory extends JschConfigSessionFactory { +public class GenericSessionFactory extends SshdSessionFactory { - @Override - protected void configure( OpenSshConfig.Host host, Session session ) { - // This prevents users from having the host in "~/.ssh/known_hosts" - java.util.Properties config = new java.util.Properties(); - config.put("StrictHostKeyChecking", "no"); - session.setConfig( config ); - } + /** + * Construct a session factory using the Apache MINA implementation. + * The default configuration matches the previous JSCH behavior of JGit. + */ + public GenericSessionFactory() { + super(); + } } diff --git a/src/java/com/ortussolutions/commandbox/jgit/SSHCallback.java b/src/java/com/ortussolutions/commandbox/jgit/SSHCallback.java index b4761abb0..7c5481f2b 100644 --- a/src/java/com/ortussolutions/commandbox/jgit/SSHCallback.java +++ b/src/java/com/ortussolutions/commandbox/jgit/SSHCallback.java @@ -11,13 +11,14 @@ import org.eclipse.jgit.api.TransportConfigCallback; import org.eclipse.jgit.transport.*; +import org.eclipse.jgit.transport.sshd.SshdSessionFactory; import com.ortussolutions.commandbox.jgit.GenericSessionFactory; public class SSHCallback implements TransportConfigCallback { public void configure(Transport transport) { - JschConfigSessionFactory genericSessionFactory = new GenericSessionFactory(); + SshdSessionFactory genericSessionFactory = new GenericSessionFactory(); SshTransport sshTransport = ( SshTransport )transport; sshTransport.setSshSessionFactory( genericSessionFactory );