我有一个 Maven 项目,我正在尝试将构建后生成的 jar 文件复制到远程 VM:
<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>com.test.start</groupId>
<artifactId>ExecutionHandler</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<!-- begin - needed for deploying to repository using webdav -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav</artifactId>
<version>2.10</version>
</extension>
<!-- end - needed for deploying to repository using webdav -->
</extensions>
</build>
<distributionManagement>
<repository>
<id>com.test.start</id>
<name>Internal Release Repository</name>
<url>dav:http://10.76.100.171/Users/Reddy/ExecutionHandler/repository/internal</url>
</repository>
<snapshotRepository>
<id>com.test.start</id>
<name>Internal Snapshot Repository</name>
<url>dav:http://10.76.100.171/Users/Reddy/ExecutionHandler/repository/snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.52.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.10</version>
</dependency>
</dependencies>
然后在主 settings.xml 文件中我有一个服务器
<servers>
<server>
<id>10.76.100.171</id>
<username>Reddy</username>
<password>Password</password>
</server>
</servers>
我尝试运行“mvn deploy”并得到以下跟踪:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project ExecutionHandler: Failed to deploy artifacts: Could not transfer artifact com.sap.start:ExecutionHandler:jar:1.0 from/to com.sap.start (dav:http://10.76.100.171/Users/Reddy/ExecutionHandler/repository/internal): Failed to create destination WebDAV collection (directory): /Users/Reddy/ExecutionHandler/repository/internal/com/sap/start/ExecutionHandler/1.0: Connection timed out: connect -> [Help 1]
远程 VM 是 Windows 7 机器:
日志跟踪中的原因是:
Failed to create destination WebDAV collection (directory):/Users/Reddy/ExecutionHandler/repository/internal/com/sap/start/ExecutionHandler/1.0:
这是一台 Windows 机器,它正在尝试创建“/Users/Reddy/...”文件夹,如果这是原因,我该如何解决?
我可以在 Windows 机器上使用远程桌面连接成功登录到 vm。
我想知道我是否遗漏了什么?在日志跟踪中,我收到警告:BASIC @10.76.100.171:80 不提供必需的凭据,请求了抢先身份验证,但没有可用的默认凭据
我在 .m2/settings.xml 文件中维护了用户名和密码。
[INFO] --- maven-install-plugin:2.4:install (default-install) @ ExecutionHandler ---
[INFO] Installing C:\Users\i318515\Desktop\Comapre\START\target\ExecutionHandler-1.0.jar to C:\Users\i318515\.m2\repository\com\sap\start\ExecutionHandler\1.0\ExecutionHandler-1.0.jar
[INFO] Installing C:\Users\i318515\Desktop\Comapre\START\pom.xml to C:\Users\i318515\.m2\repository\com\sap\start\ExecutionHandler\1.0\ExecutionHandler-1.0.pom
[INFO] Installing C:\Users\i318515\Desktop\Comapre\START\target\ExecutionHandler-1.0-sources.jar to C:\Users\i318515\.m2\repository\com\sap\start\ExecutionHandler\1.0\ExecutionHandler-1.0-sources.jar
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ ExecutionHandler ---
[INFO] Uploading: dav:http://10.76.100.171/com/sap/start/ExecutionHandler/1.0/ExecutionHandler-1.0.jar
[WARNING] Required credentials not available for BASIC <any realm>@10.76.100.171:80
[WARNING] Preemptive authentication requested but no default credentials available
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[WARNING] Required credentials not available for BASIC <any realm>@10.76.100.171:80
[WARNING] Preemptive authentication requested but no default credentials available
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] Uploading: http://10.76.100.171/com/sap/start/ExecutionHandler/1.0/ExecutionHandler-1.0.pom
[WARNING] Required credentials not available for BASIC <any realm>@10.76.100.171:80
[WARNING] Preemptive authentication requested but no default credentials available
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[WARNING] Required credentials not available for BASIC <any realm>@10.76.100.171:80
[WARNING] Preemptive authentication requested but no default credentials available
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
[INFO] Retrying request
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:41 min
[INFO] Finished at: 2016-03-01T10:16:07+05:30
[INFO] Final Memory: 13M/215M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project ExecutionHandler: Failed to deploy artifacts: Could not transfer artifact com.sap.start:ExecutionHandler:jar:1.0 from/to com.sap.start (dav:http://10.76.100.171): 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
任何帮助将不胜感激。