我一直收到此错误。我正在尝试在我的 Web 服务器上设置一个 maven 存储库。如果有人能告诉我我做错了什么,那就太好了。我正在遵循 2009 年在博客中编写的教程,但这似乎不起作用。这是一个FTP教程,所以我认为SFTP设置应该非常相似,但它似乎不起作用。
.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:UsersiHaqDesktopProjectsevent-managersrctestresources
[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:UsersiHaqDesktopProjectsevent-managertargetevent-manager-1.0.jar to C:UsersiHaq.m2repositorymeihaqevent-manager1.0event-manager-1.0.jar
[INFO] Installing C:UsersiHaqDesktopProjectsevent-managerpom.xml to C:UsersiHaq.m2repositorymeihaqevent-manager1.0event-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
绒球.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>
设置.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>
我通过将存储库 url替换为<url>sftp://ftp.envyclient.com/home/envycli1/maven.envyclient.com/</url>
来解决此问题