How to Avoid Maven builds stall on ssh host authenticity problem?
Asked Answered
C

2

10

What's the right way to keep ssh host authenticity from being a problem for maven and hudsno builds?

I have hudson building my maven project on a VM. When the ESX server with my VMs on it is taxed some of my jobs will stall out stuck in a loop of ssh host authenticity problems. The hosts were in the known hosts file, but during these times the clocks on the slave VMs have drifted far from those of my maven repo.

[INFO] Retrieving previous build number from snapshots
The authenticity of host 'maven.mycorp.com' can't be established.
DSA key fingerprint is 6d:....83.
Are you sure you want to continue connecting? (yes/no): The authenticity 
of host 'maven.mycorp.com' can't be established.

Is there something other than disabling host checking (CheckHostIP no)?

Carpio answered 21/4, 2010 at 19:33 Comment(0)
B
13

You can also do this in the Maven settings if you only want it for Maven, or you are not using scpexe://.

<server>
  <id>some-repo-id</id>
  <configuration>
    <knownHostsProvider implementation="org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider">
      <hostKeyChecking>no</hostKeyChecking>
    </knownHostsProvider>
  </configuration>
</server>
Buckden answered 22/4, 2010 at 2:49 Comment(3)
I've noticed this option doesnt seem to work for a lot of people (myself included). #8323540 - The error Im getting, "Cannot load implementation hit '...NullKnownHostsPorvider'". This is after I've extended the build with wagon-ssh-common 2.6 (which contains that class)Ascot
work for me, test with maven 3.6.1 and wagon-maven-plugin 2.0.0Noblewoman
updating to wagon-maven-plugin 2.0.0 made this setting effective. Thank you @user1686407Acanthoid
A
5

If this is not a concern, you can set StrictHostKeyChecking to no to blindly connect to the server (see this article).

Either pass the setting on the command line using the -o option:

ssh -o StrictHostKeyChecking=no

Or set it in your ~/.ssh/config:

StrictHostKeyChecking no
Ado answered 21/4, 2010 at 19:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.