I'm trying to build a jar using maven and automatically scp it to a remote machine.
This is my pom.xml
<properties>
<deploy.username>root</deploy.username>
<deploy.host>10.10.4.10</deploy.host>
<deploy.port>22</deploy.port>
<deploy.dir>/root</deploy.dir>
</properties>
<distributionManagement>
<repository>
<id>repo1</id>
<url>scpexe://${deploy.host}:${deploy.dir}</url>
</repository>
</distributionManagement>
This is my settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>repo1</id>
<username>root</username>
<password>root</password>
</server>
</servers>
</settings>
This the error log
Caused by: org.eclipse.aether.transfer.MetadataTransferException: Could not transfer metadata com.github.rssanders3.spark:spark_quick_start:1.0-SNAPSHOT/maven-metadata.xml from/to repo1 (scpexe://10.10.4.10:/root): Exit code: 1 - Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
at org.eclipse.aether.connector.basic.MetadataTransportListener.transferFailed(MetadataTransportListener.java:43)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:222)
at org.eclipse.aether.internal.impl.DefaultDeployer.upload(DefaultDeployer.java:417)
... 28 more
Caused by: org.apache.maven.wagon.TransferFailedException: Exit code: 1 - Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
You can see the full output of maven -X in here
I'm submitting using the following command:
mvn deploy -DskipTests --settings settings.xml
The user name and and password is correct, I'm able to ssh to it use this credential. I even tried to scp a file to the remote without any problem.
I check maven debug output, it is loading the user defined settings.xml I created.
[DEBUG] Reading user settings from /Users/xuanyue/tmp/apache-spark-quickstart-project/settings.xml
And on the ssh server side, this is the only thing I get:
Feb 23 14:33:02 hadoop10 sshd[23804]: Connection closed by 192.168.100.26
I also tried replace scpexe with scp. Still not worked.