gpt4 book ai didi

java - 使用 cargo maven 插件将 spring 项目部署到远程服务器

转载 作者:行者123 更新时间:2023-11-28 23:21:03 28 4
gpt4 key购买 nike

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

这是我的错误

无法在项目 travelplanner 上执行目标 org.codehaus.cargo:cargo-maven2-plugin:1.6.3:deploy (default-cli):目标 org.codehaus.cargo:cargo-maven2-plugin:1.6.3:deploy 的执行 default-cli 失败:无法使用实现类 org.codehaus.cargo.container.tomcat.TomcatWAR 为参数创建可部署对象(容器 [id = [tomcat8x]],可部署类型 [war])。InvocationTargetException:无法解析 [my workingspace\travelplanner-1.0.0-BUILD-SNAPSHOT.war] 中的 Tomcat WAR 文件:无法找到文件 [my workingspace\travelplanner-1.0.0-BUILD-SNAPSHOT.war]:我的工作空间\travelplanner-1.0.0-BUILD-SNAPSHOT.war -> [帮助 1]
[错误]

这是我的 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>

最佳答案

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

关于java - 使用 cargo maven 插件将 spring 项目部署到远程服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43759638/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com