Gretty configuration to specify ServletContainerVersion to be used


(Mohan Kornipati) #1

Hi All, We started evaluating Gretty (https://github.com/akhikhl/gretty) plugin for our projects and I am looking to see if we have any [Gretty Configuration](http://akhikhl.github.io/gretty-doc/Gretty-configuration.html) to specify the Tomcat Version / ServletContainerVersion like ‘8.0.26’ for ‘tomcat8’ along with ServletContainer as ‘tomcat8’ or ‘jetty9’

if I understand correct, looks like, Gretty seems to has fixed container versions based on ServletContainer - tomcat7, tomcat8, jetty9 and etc… Do we know if got any ways to set this?

Regards,
Mohan


(Benjamin Muschko) #2

I’d suggest you open an issue on the GitHub page of the plugin directly? The maintainer of the plugin is committed to fix issues and release a new version soon.

@Andrey_Hihlovskiy Could you please follow up on this issue?


(Andrey Hihlovskiy) #3

@mkornipati, did you open new issue for this?


(Mohan Kornipati) #4

@Andrey_Hihlovskiy @bmuschko here it is https://github.com/akhikhl/gretty/issues/232

And as workaround, we are following below approach

   def forceTomcatVersion(project, tomcatVersion) {
        def forceTomcatModules =  ["org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}",
	                "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
	                "org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}",
	                "org.apache.tomcat.embed:tomcat-embed-logging-log4j:${tomcatVersion}",
	                "org.apache.tomcat.embed:tomcat-embed-el:${tomcatVersion}"]
        if(tomcatVersion.startsWith(TOMCAT_8_VERSION_PREFIX)){
	        project.configurations.grettyRunnerTomcat8.resolutionStrategy.forcedModules = forceTomcatModules
        } else {
			project.configurations.grettyRunnerTomcat7.resolutionStrategy.forcedModules = forceTomcatModules
		}
    }
}

(Andrey Hihlovskiy) #5

Thank you for useful piece of code.
I’ll try to implement explicit control over servlet container versions in the coming Gretty 1.4.2 release (due date 01.03.2017).