I'm using wagon-maven-plugin in my pom.xml to upload JAR file to one of my remote servers.
Here is the introduction and usage of this plugin: https://www.mojohaus.org/wagon-maven-plugin/
I followed the configuration from this post, as well as its official documentation:
- Maven copy local file to remote server using SSH
- https://www.mojohaus.org/wagon-maven-plugin/usage.html
Now everything works fine for me - I can successfully upload the JAR and execute some shell commands, except that every time I execute the maven goals, it keeps poping up with a RSA key fingerprint of the remote server and asks me whether I want to continue.
The output info shows like this:
[INFO] --- wagon-maven-plugin:2.0.2:upload-single (upload-jar-to-app01) @ my-app ---
The authenticity of host 'localhost' can't be established.
RSA key fingerprint is ef:04:e4:2d:fa:0f:ee:78:ff:94:b1:dc:07:32:00:f3.
Are you sure you want to continue connecting? (yes/no): yes
Is there any way to avoid this? So that I don't have to type "yes" every time.
I think I found the solution to this issue.
Actually this have nothing to do with wagon-maven-plugin, the RSA key fingerprint pop-up is coming from a SSH client, which is implemented by Maven Wagon - yes, I also had this component as an extension in my pom.xml:
To solve this, I just need to upgrade this extension to the latest version
3.4.3, which it has feature to allow us to add parameters when connencting server via SSH. Pleases refer to this closed Github issueThe parameters should be added to
serverconfiguration in settings.xml, which looks like this: