【问题标题】:using cargo maven plugin to deploy spring project to remote server使用cargo maven插件将spring项目部署到远程服务器
【发布时间】:2017-10-01 06:16:02
【问题描述】:

我正在使用 eclipse 进行开发。我尝试使用 cargo 插件部署到远程服务器,但出现错误。我使用 EC2 作为我的服务器,使用 tomcat 8。我在尝试运行或调试时使用了cargo:deploy

这是我的错误

Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.6.3:deploy (default-cli) on project travelplanner: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.6.3:deploy failed: Failed to create deployable with implementation class org.codehaus.cargo.container.tomcat.TomcatWAR for the parameters (container [id = [tomcat8x]], deployable type [war]). InvocationTargetException: Failed to parse Tomcat WAR file in [my workingspace\travelplanner-1.0.0-BUILD-SNAPSHOT.war]: Failed to find file [my workingspace\travelplanner-1.0.0-BUILD-SNAPSHOT.war]: my workingspace\travelplanner-1.0.0-BUILD-SNAPSHOT.war -> [Help 1] [ERROR]

这是我的 pom.xml

<build>
    <plugins>
        <plugin>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <additionalProjectnatures>
                    <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                </additionalProjectnatures>
                <additionalBuildcommands>
                    <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                </additionalBuildcommands>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>true</downloadJavadocs>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <compilerArgument>-Xlint:all</compilerArgument>
                <showWarnings>true</showWarnings>
                <showDeprecation>true</showDeprecation>
            </configuration>
        </plugin>
        <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>1.6.3</version>
        <configuration>
            <container>
                <containerId>tomcat8x</containerId>
                <type>remote</type>
            </container>
            <configuration>
                <type>runtime</type>
                <properties>
                    <cargo.hostname>myIPaddress</cargo.hostname>
                    <cargo.remote.username>myId</cargo.remote.username>
                    <cargo.remote.password>myPassword</cargo.remote.password>
                    <cargo.tomcat.manager.url>http://myIpAddress:8080/manager/text
                    </cargo.tomcat.manager.url>
                </properties>
            </configuration>
            <deployables>
                    <deployable>
                        <groupId>com.rosem</groupId>
                        <artifactId>travelplanner</artifactId>
                        <type>war</type>
                    </deployable>
                </deployables>
        </configuration>
   </plugin>

    </plugins>
</build>

【问题讨论】:

    标签: java spring eclipse maven tomcat


    【解决方案1】:

    您需要指定可以找到war 文件的位置。检查插件配置中可部署标签下的位置标签。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-17
      • 2012-03-15
      • 2015-06-14
      • 1970-01-01
      • 2019-08-02
      • 1970-01-01
      • 2013-04-18
      • 2015-10-20
      相关资源
      最近更新 更多