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
2 changes: 1 addition & 1 deletion build/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1028,13 +1028,13 @@ External Dependencies:
</exclusions>
</dependency>

<dependency groupId="org.eclipse.jgit" artifactId="org.eclipse.jgit.ssh.jsch" version="${jgit.version}" dest="${lib.dir}" repoId="jgit-repository" unzip="false" type="jar">
<exclusions>
<!-- Lucee already includes these jars -->
<exclusion groupId="org.slf4j" artifactId="slf4j-api" />
<exclusion groupId="org.apache.httpcomponents" artifactId="httpclient" />
</exclusions>
</dependency>
<dependency groupId="org.eclipse.jgit" artifactId="org.eclipse.jgit.ssh.apache" version="${jgit.version}" dest="${lib.dir}" repoId="jgit-repository" unzip="false" type="jar">
<exclusions>
<!-- Lucee already includes these jars -->
<exclusion groupId="org.slf4j" artifactId="slf4j-api" />
<exclusion groupId="org.apache.httpcomponents" artifactId="httpclient" />
</exclusions>
</dependency>

<dependency groupId="com.beust" artifactId="jcommander" version="1.47" dest="${lib.dir}" type="jar" unzip="false"/>
<dependency groupId="net.minidev" artifactId="json-smart-mini" version="${json-smart-mini.version}" unzip="false" type="jar" dest="${lib.dir}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


}
3 changes: 2 additions & 1 deletion src/java/com/ortussolutions/commandbox/jgit/SSHCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down