How to fix an UnknownHostKey error when using the Maven jgitflow plugin?

99 Views Asked by At

I have many maven projects thata re hosted on Bitbucket and use the jgitflow maven plugin.

  <plugin>
        <groupId>external.atlassian.jgitflow</groupId>
        <artifactId>jgitflow-maven-plugin</artifactId>
        <version>1.0-m5.1</version>
  </plugin>

Ever since Bitbucket rotated their host keys, running mvn jgitflow:release-start on them fails with the following error:

[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start (default-cli) on project xxx: Error starting release: Error starting release: org.eclipse.jgit.api.errors.TransportException: [email protected]:abc/xxx.git: UnknownHostKey: bitbucket.org. RSA key fingerprint is 12:19:71:e8:1b:0b:74:e7:06:4a:cd:e3:20:f9:13:28 ->

This error would be expected, except I'd already gone ahead and updated the host key according to the instructions in the Bitbucket article. At the moment, running ssh [email protected] host_key_info on my computers gives the following output:

You are using host key with fingerprint:
ecdsa-sha2-nistp256 SHA256:FC73VB6C4OQLSCrjEayhMp9UMxS97caD/Yyi2bhW/J0

See https://bitbucket.org/blog/ssh-host-key-changes for more details.

Which matches the good host key from the article. Additionally, I'm able to perform git commands normally from the command line. It's just the jgitflow plugin that has the issues.

I've found a bit of a workaround by adjusting the configuration of the plugin, adding the following line:

    <configuration>
      <enableSshAgent>true</enableSshAgent>
    </configuration>

But I'd rather solve this issue at my computer's level rather than updating every single project's POM file.

0

There are 0 best solutions below