How do I enable SSL support for the tomcat plugin


(Mansour Al Akeel) #1

My first day using gradle. I was able to install tomcat plugin https://github.com/bmuschko/gradle-tomcat-plugin

Now I need to enable SSL port. The documentation for the plugin

“enableSSL: Determines whether the HTTPS connector should be created (defaults to false).”

How do I use “Convention properties”. Any example ?


(Benjamin Muschko) #2

For understanding the concept of convention properties in general the following links will help you understand them:

ConventionProperty DSL Gradle Plugin Conventions: Groovy Magic Explained

To enable SSL simply use the task name of the Tomcat plugin you are trying to use and and assign the value of the property you want to set within a closure or directly with the dot notation. Here are two examples:

tomcatRun {
    enableSSL = true
}
[tomcatRun, tomcatStop]*.enableSSL = true

I will add an example to the documentation soon.


(Mansour Al Akeel) #3

That did the trick. Thank you.