从Eclipse远程部署Tomcat webapp

时间:2023-01-24 18:35:51

For development and testing purposes I'd like to deploy my webapp from within eclipse to a remote tomcat server. Is this possible ? If not, how should I set up my development environment for smooth and easy remote deployment ?

出于开发和测试目的,我想将我的webapp从eclipse中部署到远程tomcat服务器。这可能吗 ?如果没有,我应该如何设置我的开发环境以便顺利和轻松地进行远程部署?

3 个解决方案

#1


24  

If you can access the Tomcat manager application remotely then you can use the Tomcat Ant tasks or Tomcat Maven plugin to handle this. Both of these can then be called from within Eclipse.

如果可以远程访问Tomcat管理器应用程序,则可以使用Tomcat Ant任务或Tomcat Maven插件来处理此问题。然后可以从Eclipse中调用这两个。

Using either Ant or Maven also gives you the advantage of being able to deploy from outside of Eclipse. In my experience separating deployment from the IDE is helpful (our sysadmins don't run Eclipse!).

使用Ant或Maven还可以为您提供从Eclipse外部部署的优势。根据我的经验,将部署与IDE分离是有帮助的(我们的系统管理员不运行Eclipse!)。

My personal choice is Maven, but Ant is equally capable in this area. I also use Maven profiles to let me easily switch between local/remote deployment (different server, passwords, etc).

我个人的选择是Maven,但Ant在这方面同样有能力。我还使用Maven配置文件让我轻松地在本地/远程部署(不同的服务器,密码等)之间切换。

#2


5  

For development and testing purposes I'd like to deploy my webapp from within eclipse to a remote tomcat server. Is this possible ?

出于开发和测试目的,我想将我的webapp从eclipse中部署到远程tomcat服务器。这可能吗 ?

The Tomcat support in WTP only works with a local Tomcat. That said, there is a tomcat deployer plugin that can be used to deploy to a remote tomcat (never tested personally).

WTP中的Tomcat支持仅适用于本地Tomcat。也就是说,有一个tomcat deployer插件可用于部署到远程tomcat(从未亲自测试过)。

If not, how should I set up my development environment for smooth and easy remote deployment ?

如果没有,我应该如何设置我的开发环境以便顺利和轻松地进行远程部署?

If you don't like the plugin, then you could use build tools like Ant or Maven, they have good support for remote deployment trough the manager application as pointed out by Chris. I'd just add Cargo to the list (Tomcat remote deployment is only available with the Maven 2 plugin though).

如果您不喜欢该插件,那么您可以使用像Ant或Maven这样的构建工具,他们通过Chris指出的管理器应用程序可以很好地支持远程部署。我只是将Cargo添加到列表中(Tomcat远程部署仅适用于Maven 2插件)。

Actually, using a build tool would be a good idea regardless of Eclipse capabilities in my opinion.

实际上,在我看来,无论Eclipse功能如何,使用构建工具都是一个好主意。

#3


5  

You can use the Ant FTP task or SCP task for this. You can find examples here.

您可以使用Ant FTP任务或SCP任务。你可以在这里找到例子。

#1


24  

If you can access the Tomcat manager application remotely then you can use the Tomcat Ant tasks or Tomcat Maven plugin to handle this. Both of these can then be called from within Eclipse.

如果可以远程访问Tomcat管理器应用程序,则可以使用Tomcat Ant任务或Tomcat Maven插件来处理此问题。然后可以从Eclipse中调用这两个。

Using either Ant or Maven also gives you the advantage of being able to deploy from outside of Eclipse. In my experience separating deployment from the IDE is helpful (our sysadmins don't run Eclipse!).

使用Ant或Maven还可以为您提供从Eclipse外部部署的优势。根据我的经验,将部署与IDE分离是有帮助的(我们的系统管理员不运行Eclipse!)。

My personal choice is Maven, but Ant is equally capable in this area. I also use Maven profiles to let me easily switch between local/remote deployment (different server, passwords, etc).

我个人的选择是Maven,但Ant在这方面同样有能力。我还使用Maven配置文件让我轻松地在本地/远程部署(不同的服务器,密码等)之间切换。

#2


5  

For development and testing purposes I'd like to deploy my webapp from within eclipse to a remote tomcat server. Is this possible ?

出于开发和测试目的,我想将我的webapp从eclipse中部署到远程tomcat服务器。这可能吗 ?

The Tomcat support in WTP only works with a local Tomcat. That said, there is a tomcat deployer plugin that can be used to deploy to a remote tomcat (never tested personally).

WTP中的Tomcat支持仅适用于本地Tomcat。也就是说,有一个tomcat deployer插件可用于部署到远程tomcat(从未亲自测试过)。

If not, how should I set up my development environment for smooth and easy remote deployment ?

如果没有,我应该如何设置我的开发环境以便顺利和轻松地进行远程部署?

If you don't like the plugin, then you could use build tools like Ant or Maven, they have good support for remote deployment trough the manager application as pointed out by Chris. I'd just add Cargo to the list (Tomcat remote deployment is only available with the Maven 2 plugin though).

如果您不喜欢该插件,那么您可以使用像Ant或Maven这样的构建工具,他们通过Chris指出的管理器应用程序可以很好地支持远程部署。我只是将Cargo添加到列表中(Tomcat远程部署仅适用于Maven 2插件)。

Actually, using a build tool would be a good idea regardless of Eclipse capabilities in my opinion.

实际上,在我看来,无论Eclipse功能如何,使用构建工具都是一个好主意。

#3


5  

You can use the Ant FTP task or SCP task for this. You can find examples here.

您可以使用Ant FTP任务或SCP任务。你可以在这里找到例子。