通过 Cargo Ant 任务进行远程 Tomcat 部署
我试图使用 Cargo Ant 任务 版本 1.0.6 将 WAR 文件部署到远程 Tomcat服务器。据我从文档中看到,我必须将容器类型设置为remote
,将配置类型设置为runtime
。但是,当我运行它时,我收到以下错误消息:
You must specify either a [home] attribute pointing to the location where the Tomcat 6.x Remote is installed, or a nested [zipurlinstaller] element
此错误消息对我来说不太有意义,因为我不想设置 home
(它位于不同的服务器上)并且我不想从 URL (zipurlinstaller
) 下载 Tomcat,因为我的服务器上已经安装了 Tomcat。我认为使用 remote
类型可以避免在 home
和 zipurlinstaller
之间进行选择。我在这里缺少特定参数吗?
这是我的蚂蚁代码:
<taskdef resource="cargo.tasks">
<classpath>
<pathelement location="${cargo-uberjar}"/>
<pathelement location="${cargo-antjar}"/>
</classpath>
</taskdef>
<target name="cargostart" depends="war">
<cargo containerId="tomcat6x" type="remote" action="start" wait="false">
<configuration type="runtime">
<property name="cargo.tomcat.manager.url" value="http://someserver:8080/manager"/>
<property name="cargo.remote.username" value="username"/>
<property name="cargo.remote.password" value="password"/>
<deployable type="war" file="${mywarfile}"/>
</configuration>
</cargo>
</target>
I was trying to deploy a WAR file using the Cargo Ant task version 1.0.6 to a remote Tomcat server. As far as I can see from the documentation I have to set the container type to remote
and the configuration type to runtime
. However, when I run it I get the following error message:
You must specify either a [home] attribute pointing to the location where the Tomcat 6.x Remote is installed, or a nested [zipurlinstaller] element
This error message doesn't quite make sense to me because I don't want to set the home
(it sits on a different server) and I don't want to download Tomcat from an URL (zipurlinstaller
) because I already have an installation on my server. I thought using the type remote
would prevent having to choose between home
and zipurlinstaller
. Am I missing a specific parameter here?
Here's my Ant code:
<taskdef resource="cargo.tasks">
<classpath>
<pathelement location="${cargo-uberjar}"/>
<pathelement location="${cargo-antjar}"/>
</classpath>
</taskdef>
<target name="cargostart" depends="war">
<cargo containerId="tomcat6x" type="remote" action="start" wait="false">
<configuration type="runtime">
<property name="cargo.tomcat.manager.url" value="http://someserver:8080/manager"/>
<property name="cargo.remote.username" value="username"/>
<property name="cargo.remote.password" value="password"/>
<deployable type="war" file="${mywarfile}"/>
</configuration>
</cargo>
</target>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
长话短说 Cargo 版本 1.0.6 不支持通过 Ant 任务进行远程部署。不过,1.1.0 将支持它,并将在未来几周内发布。您可以在 上阅读有关此主题的讨论Cargo 用户邮件列表。 Jira 票证 CARGO-962 解决了这个问题。
Long story short Cargo version 1.0.6 does not support remote deployment via the Ant tasks. However, 1.1.0 will support it which will be released in the upcoming weeks. You read the discussion about this topic on the Cargo user mailing list. The Jira ticket CARGO-962 addresses the issue.