Azure Tomcat Eclipse部署 [英] Azure Tomcat Eclipse Deployment
问题描述
根据我的经验,在Eclipse中连续部署Tomcat Web应用程序的简单方法是使用本地Git存储库。
首先,创建一个动态Web项目
在Eclipse中使用Tomcat。创建与正常步骤不同的项目有一个关键步骤。配置Web模块设置时,需要为Content目录设置 webapps / ROOT
,如下所示:
然后,项目结构树如下所示:
其次,在Azure Portal上配置Azure WebApp的持续部署。
完成上述操作后,复制git cmd的git clone url。
直到现在,打开git bash将项目推送到Azure。步骤如下。
- 打开git bash cmd和
cd
到项目目录< app-name>
。 -
git init
-
git添加webapps
-
git commit -m初始提交 code>
-
git remote add< app-name> < git-clone-url>
-
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.
- Open the git bash cmd and
cd
into project directory<app-name>
. git init
git add webapps
git commit -m "Initial Commit"
git remote add <app-name> <git-clone-url>
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屋!