简体   繁体   中英

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://root@www.french.com/): 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?

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, ie user@host:port

*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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM