简体   繁体   English

使用gradle tomcat插件

[英]Using the gradle tomcat plugin

I am trying to fiddle with the gradle-tomcat-plugin and I am having some issues with some of the preliminaries. 我正在尝试使用gradle-tomcat-plugin进行调试 ,而一些预备赛却遇到了一些问题。 Assuming that my WAR is present in one of my folders, what do I need to do in order to run the war in an embedded tomcat using gradles tomcat plugin? 假设我的WAR存在于我的一个文件夹中,我需要做什么才能使用gradles tomcat插件在嵌入式tomcat中进行战争? The readme mentions the tomcatRunWar but I am a little lost as to how to use it in my gradle file 自述文件提到了tomcatRunWar但是我对如何在gradle文件中使用它有些迷惑

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks 谢谢

if you have set up everything right 如果一切设置正确

go to your root directory (your build.gradle file should lie there), then execute 转到您的根目录(您的build.gradle文件应该位于此处),然后执行

gradle tasks

and you should see tomcats different tasks 并且您应该看到tomcats不同的任务

  • tomcatRun: Starts a Tomcat instance and deploys the exploded web application to it. tomcatRun:启动Tomcat实例并将展开的Web应用程序部署到该实例。
  • tomcatRunWar: Starts a Tomcat instance and deploys the WAR to it. tomcatRunWar:启动Tomcat实例并将WAR部署到该实例。
  • tomcatStop: Stops the Tomcat instance. tomcatStop:停止Tomcat实例。
  • tomcatJasper: Runs the JSP compiler (Jasper) and turns JSP pages into Java source using. tomcatJasper:运行JSP编译器(Jasper),并使用将JSP页面转换成Java源代码。

and then you just run it 然后你就运行它

gradle tomcatRunWar

myself I prefer jetty plugin 我自己更喜欢码头插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM