I am trying to use JGit. I tried following http://www.codeaffine.com/2014/12/09/jgit-authentication/ and the following block of the code throws a ClassCastException
remoteRepository.setTransportConfigCallback(new TransportConfigCallback() {
@Override
public void configure(Transport transport) {
SshTransport sshTransport = (SshTransport) transport;
sshTransport.setSshSessionFactory(sshSessionFactory);
}
});
Exception:
java.lang.ClassCastException: org.eclipse.jgit.transport.TransportHttp cannot be cast to org.eclipse.jgit.transport.SshTransport
What am I missing? I am using JGit version 4.10.0.201712302008-r.