Showing posts with label Gradle. Show all posts

IntelliJ with Tomcat and Gradle - Smart Tomcat

by GarciaPL on Sunday, 9 July 2017

Last time I was describing how to enable Tomcat for projects maintained by Gradle in post with title called "IntelliJ with Tomcat and Gradle using Gretty plugin". The thing that I found recently even a better way to achieve that! Moreover this way is less invasive in terms of that you do not need to append any configuration to your gradle scripts! This better way is known as a Smart Tomcat! It is a plugin for IntelliJ which allow you to configure literally everything around your app if it should be run on Tomcat.

Smart Tomcat - IntelliJ IDEA Plugins

IntelliJ with Tomcat and Gradle using Gretty plugin

by GarciaPL on Thursday, 27 April 2017

This time I would like to describe briefly how to enable Tomcat in debug & class reload mode on IntelliJ when project is built using Gradle using this time Gretty plugin [1].

1) Add below line to build.gradle after applied war plugin

apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin'

2) At the end of build.gradle add also below statement which allows us to reload classes in container in the fly after change made by you in IntelliJ

gretty {
    managedClassReload = true
}

3) Add Remote item in IntelliJ [3]

4) Run project using below command line

gradle tomcatStartDebug --info

5) Pickup Remote item in IntelliJ and run it in debug mode

6) Place breakpoints and run the code to catch them


Reference :
[1] https://github.com/akhikhl/gretty
[2] Hot deployment in Gretty
[3] Adding Remote item in IntelliJ