Can Maven Wagon plugin be configured to use a private key for ssh/scp? Everything I've tried still leaves maven to ask me for a password when it gets to the point of scp-ing.
相关问题
- JavaScript File Transfer SSH
- How to resolve Maven exec plugin: classpath too lo
- Why does this bash script work at console but fail
- Maven: How to read the Parent POM version
- SSH Fingerprint not authorized on Heroku after git
相关文章
- Check if directory exists on remote machine with s
- Git Clone Fails: Server Certificate Verification F
- Test if File/Dir exists over SSH/Sudo in Python/Ba
- Can't access AWS CodeCommit with SSH
- Maven directory structure
- Passing the Maven Debug Flag from Hudson
- Sanity check SSH public key? [closed]
- Spark EC2 SSH connection error SSH return code 255
I found the necessary info here: http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html
You should be able to specify the path to the private key in the server element in your settings.xml:
Pay a special attention to the "note": If you use a private key to login to the server, make sure you omit the
<password>
element. Otherwise, the key will be ignored. So the final configuration will be close to:I know this is an old thread, but it looks like the Wagon plugin is reading settings.xml (e.g. username) but not using all of the settings. I could not get it to stop asking for Kerberos username/password during scp. (Looks like there might have been changes to plugin late 2016 that affect this.) Just adding this answer in case it helps someone else.
For me, the solution was even simpler: totally skip using 'settings.xml' and simply specify 'scpexe' instead of 'scp' for protocol (like under distributionManagement section of pom.xml). This then uses your machine's default SSH configuration (unix settings under ~/.ssh).