javamavenmaven-wagon-pluginwagon

wagon-ftp "Connection timed out"


I keep getting this error. I am trying to set up a maven repo on my web server. If someone could tell me what I am doing wrong that would be great. I was following a tutorial written in a blog back in 2009 but that does not seem to work. It was a tutorial for FTP so I was thinking SFTP setup should be very similar but it does not seem to work.

log

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for me.ihaq:event-manager:jar:1.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 19, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building event-manager 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ event-manager ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ event-manager ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ event-manager ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\iHaq\Desktop\Projects\event-manager\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ event-manager ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ event-manager ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ event-manager ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ event-manager ---
[INFO] Installing C:\Users\iHaq\Desktop\Projects\event-manager\target\event-manager-1.0.jar to C:\Users\iHaq\.m2\repository\me\ihaq\event-manager\1.0\event-manager-1.0.jar
[INFO] Installing C:\Users\iHaq\Desktop\Projects\event-manager\pom.xml to C:\Users\iHaq\.m2\repository\me\ihaq\event-manager\1.0\event-manager-1.0.pom
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ event-manager ---
Uploading: scp://envyclient.com/home/envycli1/maven.envyclient.com/me/ihaq/event-manager/1.0/event-manager-1.0.jar
Uploading: scp://envyclient.com/home/envycli1/maven.envyclient.com/me/ihaq/event-manager/1.0/event-manager-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.075 s
[INFO] Finished at: 2018-05-09T20:39:40-04:00
[INFO] Final Memory: 13M/226M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project event-manager: Failed to deploy artifacts: Could not transfer artifact me.ihaq:event-manager:jar:1.0 from/to envyclient-maven (scp://envyclient.com/home/envycli1/maven.envyclient.com): Cannot connect. Reason: java.net.ConnectException: Connection timed out: connect -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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

Process finished with exit code 1

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>me.ihaq</groupId>
    <artifactId>event-manager</artifactId>
    <version>1.0</version>
    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>3.0.0</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <distributionManagement>
        <repository>
            <id>envyclient-maven</id>
            <url>scp://envyclient.com/home/envycli1/maven.envyclient.com</url>
        </repository>
    </distributionManagement>

</project>

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>envyclient-maven</id>
            <username>***</username>
            <password>***</password>
        </server>
    </servers>

</settings>

Solution

  • I fixed this issue by replacing repository url with <url>sftp://ftp.envyclient.com/home/envycli1/maven.envyclient.com/</url>