kwin commented on code in PR #153: URL: https://github.com/apache/maven-scm/pull/153#discussion_r923036873
########## maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/JGitTransportConfigCallback.java: ########## @@ -19,47 +19,22 @@ * under the License. */ -import com.jcraft.jsch.JSch; -import com.jcraft.jsch.JSchException; -import com.jcraft.jsch.Session; -import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.eclipse.jgit.api.TransportConfigCallback; -import org.eclipse.jgit.transport.JschConfigSessionFactory; -import org.eclipse.jgit.transport.OpenSshConfig; -import org.eclipse.jgit.transport.SshSessionFactory; import org.eclipse.jgit.transport.SshTransport; import org.eclipse.jgit.transport.Transport; -import org.eclipse.jgit.util.FS; -import org.eclipse.jgit.util.StringUtils; -import org.slf4j.Logger; +import org.eclipse.jgit.transport.sshd.SshdSessionFactory; /** * Implementation of {@link TransportConfigCallback} which adds * a public/private key identity to ssh URLs if configured. */ public class JGitTransportConfigCallback implements TransportConfigCallback { - private SshSessionFactory sshSessionFactory = null; + private final SshdSessionFactory sshSessionFactory; - public JGitTransportConfigCallback( GitScmProviderRepository repo, Logger logger ) + public JGitTransportConfigCallback( SshdSessionFactory sshSessionFactory ) { - if ( repo.getFetchInfo().getProtocol().equals( "ssh" ) ) - { - if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() == null ) - { - logger.debug( "using private key: " + repo.getPrivateKey() ); - sshSessionFactory = new UnprotectedPrivateKeySessionFactory( repo ); - } - else if ( !StringUtils.isEmptyOrNull( repo.getPrivateKey() ) && repo.getPassphrase() != null ) - { - logger.debug( "using private key with passphrase: " + repo.getPrivateKey() ); Review Comment: Done in https://github.com/apache/maven-scm/pull/153/files#diff-3064603a61755ca86ec700eac6db708bb3eed5ed98993ce19aa2c1914d6b0f8dR58. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org