Maven将jar部署到远程VM / Server

时间:2016-02-29 06:45:08

标签: 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">
<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>

然后在main 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

任何帮助都将受到高度赞赏。

0 个答案:

没有答案