Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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? The readme mentions the tomcatRunWar but I am a little lost as to how to use it in my gradle file

Any help would be appreciated.

Thanks

like image 366
sc_ray Avatar asked May 22 '12 18:05

sc_ray


People also ask

What is the use of plugins Gradle?

It can do things such as: Extend the Gradle model (e.g. add new DSL elements that can be configured) Configure the project according to conventions (e.g. add new tasks or configure sensible defaults) Apply specific configuration (e.g. add organizational repositories or enforce standards)

Can I use a Gradle plugin in Maven?

The Maven Plugin Builder Gradle Plugin lets you generate the Maven plugin descriptor for any Mojos found in your project. The plugin has been successfully tested with Gradle 4.10.

What is Gradle and Gradle plugin?

Android Gradle plugin and Android Studio compatibilityThe Android Studio build system is based on Gradle, and the Android Gradle plugin adds several features that are specific to building Android apps. The following table lists which version of the Android Gradle plugin is required for each version of Android Studio.


1 Answers

if you have set up everything right

go to your root directory (your build.gradle file should lie there), then execute

gradle tasks

and you should see tomcats different tasks

  • tomcatRun: Starts a Tomcat instance and deploys the exploded web application to it.
  • tomcatRunWar: Starts a Tomcat instance and deploys the WAR to it.
  • tomcatStop: Stops the Tomcat instance.
  • tomcatJasper: Runs the JSP compiler (Jasper) and turns JSP pages into Java source using.

and then you just run it

gradle tomcatRunWar

myself I prefer jetty plugin

like image 101
Luis Ramirez-Monterosa Avatar answered Oct 23 '22 00:10

Luis Ramirez-Monterosa