eclipse 远程Tomcat上Java应用的自动部署

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6484055/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:30:39  来源:igfitidea点击:

Automatic Deployment of Java application on Remote Tomcat

javaeclipsetomcatdeployment

提问by Alp

I want to be able to automatically deploy a Java application to a tomcat server.

我希望能够自动将 Java 应用程序部署到 tomcat 服务器。

Current situation:

现在的情况:

  • A Java project is under developement in Eclipse
  • A Tomcat Server is running on another machine, serving a WAR file of that project
  • 一个 Java 项目正在 Eclipse 中开发
  • Tomcat 服务器正在另一台机器上运行,为该项目的 WAR 文件提供服务

My goal: An easy possibility to compile and deploy the project into the remote Tomcat server.I don't mind if that would be a console command/script or by using the Eclipse GUI.

我的目标:将项目编译和部署到远程 Tomcat 服务器的简单可能性。我不介意那是控制台命令/脚本还是使用 Eclipse GUI。

Is that possible? If yes, how? (If there are possibilites, which need changes on my setup, feel free to give me advice for a better suiting setup)

那可能吗?如果是,如何?(如果有可能需要更改我的设置,请随时给我建议以获得更适合的设置)

Update

更新

Yes, i use Maven.

是的,我使用 Maven。

采纳答案by Slava Semushin

If you use Maven I will suggest to use Cargo pluginwhich supports all Tomcat's version and have ability to deploy to local and remote servers.

如果你使用 Maven,我会建议使用Cargo 插件,它支持所有 Tomcat 的版本并且能够部署到本地和远程服务器

回答by Benjamin Muschko

If you prefer not to go with Maven or the Cargo plugin you can simply invoke the Tomcat manager deploy URL. Under the covers Cargo is basically doing the same thing. Tomcat also provides Ant tasksto wrap the manager commands. Using the Ant tasks would enable you to invoke them in Eclipse without a plugin.

如果您不想使用 Maven 或 Cargo 插件,您可以简单地调用Tomcat 管理器部署 URL。在幕后 Cargo 基本上做着同样的事情。Tomcat 还提供了Ant 任务来包装管理器命令。使用 Ant 任务将使您无需插件即可在 Eclipse 中调用它们。

回答by Thorbj?rn Ravn Andersen

I believe Cargo can do what you want in a general fashion (but I have not tried personally) http://cargo.codehaus.org/Tomcat+6.x

我相信 Cargo 可以以一般的方式做你想做的事情(但我没有亲自尝试过)http://cargo.codehaus.org/Tomcat+6.x

Also Tomcat has an administrative webapp that can accept WAR's by upload, but I would look at Cargo first.

Tomcat 也有一个管理 web 应用程序,可以通过上传接受 WAR,但我会​​先看看 Cargo。