Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven将jar部署到远程VM/服务器_Java_Maven_Maven Deploy Plugin_Maven Wagon Plugin - Fatal编程技术网

Java Maven将jar部署到远程VM/服务器

Java Maven将jar部署到远程VM/服务器,java,maven,maven-deploy-plugin,maven-wagon-plugin,Java,Maven,Maven Deploy Plugin,Maven Wagon Plugin,我有一个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"> &

我有一个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>
远程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
[INFO]——maven安装插件:2.4:install(默认安装)@ExecutionHandler---
[信息]正在将C:\Users\i318515\Desktop\Comapre\START\target\ExecutionHandler-1.0.jar安装到C:\Users\i318515\.m2\repository\com\sap\START\ExecutionHandler\1.0\ExecutionHandler-1.0.jar
[信息]正在将C:\Users\i318515\Desktop\Comapre\START\pom.xml安装到C:\Users\i318515\.m2\repository\com\sap\START\ExecutionHandler\1.0\ExecutionHandler-1.0.pom
[信息]正在将C:\Users\i318515\Desktop\Comapre\START\target\ExecutionHandler-1.0-sources.jar安装到C:\Users\i318515\.m2\repository\com\sap\START\ExecutionHandler\1.0\ExecutionHandler-1.0-sources.jar
[信息]
[信息]---maven部署插件:2.7:deploy(默认部署)@ExecutionHandler---
[信息]上传:dav:http://10.76.100.171/com/sap/start/ExecutionHandler/1.0/ExecutionHandler-1.0.jar
[警告]BASIC@10.76.100.171:80的必需凭据不可用
[警告]已请求抢占式身份验证,但没有可用的默认凭据
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[警告]BASIC@10.76.100.171:80的必需凭据不可用
[警告]已请求抢占式身份验证,但没有可用的默认凭据
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]上传:http://10.76.100.171/com/sap/start/ExecutionHandler/1.0/ExecutionHandler-1.0.pom
[警告]BASIC@10.76.100.171:80的必需凭据不可用
[警告]已请求抢占式身份验证,但没有可用的默认凭据
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[警告]BASIC@10.76.100.171:80的必需凭据不可用
[警告]已请求抢占式身份验证,但没有可用的默认凭据
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]处理请求时捕获I/O异常(java.net.ConnectException):连接超时:连接
[信息]正在重试请求
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:05:41分钟
[信息]完成时间:2016-03-01T10:16:07+05:30
[信息]最终内存:13M/215M
[信息]------------------------------------------------------------------------
[错误]未能在项目ExecutionHandler上执行目标org.apache.maven.plugins:maven部署插件:2.7:deploy(默认部署):未能部署工件:无法将工件com.sap.start:ExecutionHandler:jar:1.0从/传输到com.sap.start(dav:http://10.76.100.171):连接超时:连接->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

任何帮助都将不胜感激。

检查远程计算机中的“reddy”写入权限user@user3662273用户Reddy是VM的管理员。您使用哪个Maven版本?您使用的是哪种马车版本?@khmarbaise Maven version:apache-Maven-3.0.5上面的pom.xml中提到了马车,请参考上面的代码以查找其他版本details@khmarbaiseMaven版本:apache-Maven-3.0.5;货车版本:1.0-beta-2
Failed to create destination WebDAV collection (directory):/Users/Reddy/ExecutionHandler/repository/internal/com/sap/start/ExecutionHandler/1.0:
[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