Azure Tomcat Eclipse部署 [英] Azure Tomcat Eclipse Deployment

查看:178
本文介绍了Azure Tomcat Eclipse部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行我的Tomcat网络应用程序的天蓝色服务器。一切都行之有效,但我发现出口我的战争,取消部署,然后将战争重新部署到Tomcat是一件麻烦。在我的开发环境中,我在eclipse中运行Tomcat并运行最新的代码。在我的天蓝色服务器上运行eclipse的问题是什么,让Eclipse在Eclipse中运行我的网络应用程序?这样,任何改变,我可以简单地将我最新的代码拉入eclipse并重新启动tomcat。这是生产中的一个坏主意,为什么?如果有任何建议,如何使这更容易?我不希望将tomcat管理器应用程序暴露给世界,所以请不要建议。

解决方案

根据我的经验,在Eclipse中连续部署Tomcat Web应用程序的简单方法是使用本地Git存储库。



首先,创建一个动态Web项目在Eclipse中使用Tomcat。创建与正常步骤不同的项目有一个关键步骤。配置Web模块设置时,需要为Content目录设置 webapps / ROOT ,如下所示:





然后,项目结构树如下所示:





其次,在Azure Portal上配置Azure WebApp的持续部署。





完成上述操作后,复制git cmd的git clone url。





直到现在,打开git bash将项目推送到Azure。步骤如下。


  1. 打开git bash cmd和 cd 到项目目录< app-name>

  2. git init

  3. git添加webapps

  4. git commit -m初始提交 code>

  5. git remote add< app-name> < git-clone-url>

  6. git push< app-name>主人

现在,您可以浏览 https://< app-名称> .azurewebsites.net / 可以看到它。



为了持续发展,你只需要重复步骤3,4和6。


I have an azure server that runs my Tomcat web apps. Everything works well but I find that exporting my war, undeploying, then redeploying the war to Tomcat is a hassle. On my dev environment I run Tomcat within eclipse and have my latest code to run. What would be the problem with running eclipse on my azure server, having Tomcat run within eclipse to run my web apps? This way with any change I can simply git pull my latest code into eclipse and restart tomcat. Is this a bad idea in production and why? If so any recommendations on how to make this easier? I would rather not expose the tomcat manager application to the world so please don't recommend that.

解决方案

Per my experience, the easy way to continuous deployment for Tomcat web apps in Eclipse is using local Git repository.

First, Create a Dynamic Web Project with Tomcat in Eclipse. There is a key step for creating project different from normal step. When configuring web module settings, need to set webapps/ROOT for Content directory, see below:

Then, the project structure tree as below:

Second, Configure the continuous deployment for Azure WebApp on Azure Portal.

After done above, copy the git clone url for git cmd.

Until now, open the git bash to push project into Azure. The steps as below.

  1. Open the git bash cmd and cd into project directory <app-name>.
  2. git init
  3. git add webapps
  4. git commit -m "Initial Commit"
  5. git remote add <app-name> <git-clone-url>
  6. git push <app-name> master

Now, you can browse https://<app-name>.azurewebsites.net/ to see it.

For continous developement, you just need to repeat the step 3, 4 and 6.

这篇关于Azure Tomcat Eclipse部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆