Open gunnarmorling opened 1 year ago
Some more context on this one: my git remote was configured to use SSH, not HTTPS. This seems to generally be unsupported with JReleaser currently, since even when I added that dependency, things wouldn't work. It'd still try to authenticate with user name and PAT (as the UsernamePasswordCredentialsProvider
is hard-coded in ReleaseUtils
), instead of using key-based authentication.
IMO, the best solution to all this would be to use the native git installation (by launching an external process) instead of using jgit. Then I should be able to use key-based auth, with the key passphrase being retrieved from my SSH agent. Another issue with jgit is that the jsch dependency isn't actively maintained, so newer key formats like ed25519 aren't supported.
I got unstuck by changing my remote to use HTTPS, I think it's worth calling out in the docs that SSH isn't supported atm.? And/or fail eagerly with a descriptive error message when detecting that SSH is used.
Failing quickly when SSH is configured as protocol sounds like a quick win we should support right away.
Switching to external git command will take more effort but it's feasible.
Edge case here - only realized the problem was SSH after I found this issue. I had git configured to globally use ssh instead of https, which I feel is fairly common. It would be a good idea to call this out in the docs, or more specifically, the checklist. Thanks!
FWIW regarding the state of jsch
👇 https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/68bd2c146239b87d355ed6169ca0ec227a69995d/org.eclipse.jgit.ssh.jsch/
JGit SSH support via JSch
This bundle provides an implementation of git transport over SSH implemented via JSch.
This bundle should be considered deprecated. It is essentially unmaintained, and the JGit project may decide anytime to remove it completely without further ado.
The officially supported SSH transport is in bundle org.eclipse.jgit.ssh.apache and is built upon Apache MINA sshd.
Getting this one:
Seems like that
org.eclipse.jgit.ssh.jsch
dependency would need to be added?