Grim
Grim

Reputation: 2040

Maven deploy, specify port

Reading the deploy manual id like to specify a different port using

<sshArgs>-P 7221</sshArgs>

in the settings.xml.

But I get a

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy 
  (default-deploy) on project french-toast: Failed to retrieve remote metadata 
  com.foobar:french-toast:1.1.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata 
  com.foobar:french-toast:1.1.0-SNAPSHOT/maven-metadata.xml from/to french-id 
  (scpexe://[email protected]/): Exit code: 1 - ssh: connect to host www.french.com 
  port 22: Connection refused -> [Help 1]

The port 22 is used.

How to change the port? What did I miss?

Upvotes: 3

Views: 2303

Answers (2)

Antonis
Antonis

Reputation: 11

*Go to your deploy profile inside pom and in the configuration tag add and specify the port.

<configuration>
               <user>serverusername</user>
                  <password>serverpass@$#</password>
                  <name>project.build.finalName</name>
                    <adminurl>localhost:7003</adminurl>      ---> Here is the answer                   
               <source>youdirectory/finalName.packaging</source>
</configuration>

Upvotes: 0

Adonis
Adonis

Reputation: 4818

Actually the ssh argument for a port is [-p port] (notice that your are using a capital P), see a man ssh page. Alternatively, you could also use the ssh syntax, i.e. user@host:port

Upvotes: 1

Related Questions