Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6877817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:38:48+00:00 2026-05-27T04:38:48+00:00

I am trying to copy the resources to a server using scp with wagon

  • 0

I am trying to copy the resources to a server using scp with wagon.

What is the purpose of adding repository under distributionManagement?

My pom.xml looks like this

<distributionManagement>
            <repository>
                <id>iq</id>
                <url>ftp://server:port</url>
            </repository>
</distributionManagement>
<build>
    <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ftp</artifactId>
            <version>1.0-beta-6</version>
        </extension>
    </extensions>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>wagon-maven-plugin</artifactId>
            <version>1.0-beta-3</version>
             <extensions>true</extensions>
            <executions>
                <execution>
                    <phase>deploy</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                        <serverId>iq</serverId>
                        <fromDir>src/main/webapps</fromDir>
                        <url>scp:ftp://server:port</url>
                        <toDir>.iq/resources/</toDir>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>

And my settings.xml file is

<servers>
    <server>
      <id>iq</id>
      <username>user</username>
      <password>pass</password>      
    </server>
</servers>

*Error is *

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project iq-resources: Failed to deploy artifacts: Could not transfer artifact test.com.test:resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server. Could not parse response code.
[ERROR] Server Reply: SSH-2.0-OpenSSH_4.3
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project iq-resources: Failed to deploy artifacts: Could not transfer artifact test.com.test:resources:jar:2.50.6.a from/to  (ftp://server:port): Could not connect to server.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact :resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server.
    at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:189)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server.
    at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:140)
    at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:156)
    ... 21 more
Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server.
    at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:259)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:380)
    at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:136)
    ... 22 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact  resources:jar:2.50.6.a from/to iq (ftp://server:port): Could not connect to server.
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:949)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.flush(WagonRepositoryConnector.java:864)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:465)
    at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeployer.java:253)
    ... 24 more
Caused by: org.apache.maven.wagon.authentication.AuthenticationException: Could not connect to server.
    at org.apache.maven.wagon.providers.ftp.FtpWagon.openConnectionInternal(FtpWagon.java:154)
    at org.apache.maven.wagon.AbstractWagon.openConnection(AbstractWagon.java:105)
    at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:207)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.connectWagon(WagonRepositoryConnector.java:326)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.pollWagon(WagonRepositoryConnector.java:366)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$PutTask.run(WagonRepositoryConnector.java:817)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.put(WagonRepositoryConnector.java:464)
    ... 25 more
Caused by: org.apache.commons.net.MalformedServerReplyException: Could not parse response code.
Server Reply: SSH-2.0-OpenSSH_4.3
    at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:315)
    at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:364)
    at org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:540)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:178)
    at org.apache.maven.wagon.providers.ftp.FtpWagon.openConnectionInternal(FtpWagon.java:119)
    ... 31 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:38:48+00:00Added an answer on May 27, 2026 at 4:38 am

    ftp and scp are two different protocols. The error is because you are trying to use wagon-ftp library to do scp.

    First check what exactly is the server that you have – ftp or scp. If ftp, you may want to remove scp from the url. If scp, then you may want to use wagon-ssh library.

    Also refer to wagon documentation for the various transport abstractions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to copy data from my MYSQL table to SQL Server using
I am trying to copy a file from my remote server to my local.
I am trying to copy the contents of certain folders to another folder using
I'm trying to copy a directory using the Ant copy task. I am a
I have a list of files that I'm trying to copy and move (using
I am trying to copy an mp3 file from my Resources folder to a
I'm trying to copy resources (IFile) from an eclipse project to another location. The
I am trying to copy the the dependent rsls into war using the copy-
We are trying to copy a file from a server, down to a local
I'm trying to copy both an image from a file and text from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.