mkornipati
(Mohan Kornipati)
December 22, 2015, 3:18pm
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?
String jetty7ServletApiVersion = Externalized.getString('jetty7ServletApiVersion')
String jetty8Version = Externalized.getString('jetty8Version')
String jetty8ServletApi = Externalized.getString('jetty8ServletApi')
String jetty8ServletApiVersion = Externalized.getString('jetty8ServletApiVersion')
String jetty9Version = Externalized.getString('jetty9Version')
String jetty9ServletApi = Externalized.getString('jetty9ServletApi')
String jetty9ServletApiVersion = Externalized.getString('jetty9ServletApiVersion')
String tomcat7Version = Externalized.getString('tomcat7Version')
String tomcat7ServletApi = Externalized.getString('tomcat7ServletApi')
String tomcat7ServletApiVersion = Externalized.getString('tomcat7ServletApiVersion')
String tomcat8Version = Externalized.getString('tomcat8Version')
String tomcat8ServletApi = Externalized.getString('tomcat8ServletApi')
String tomcat8ServletApiVersion = Externalized.getString('tomcat8ServletApiVersion')
[ 'jetty7': [
servletContainerType: 'jetty',
servletContainerVersion: jetty7Version,
servletContainerDescription: "Jetty $jetty7Version",
servletContainerRunnerConfig: 'grettyRunnerJetty7',
servletContainerRunnerDependencies: { project ->
project.dependencies.add servletContainerRunnerConfig, "org.akhikhl.gretty:gretty-runner-jetty7:$grettyVersion"
addRedirectFilter(project, servletContainerRunnerConfig)
Regards,
Mohan
bmuschko
(Benjamin Muschko)
January 23, 2017, 3:31pm
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?
@mkornipati , did you open new issue for this?
mkornipati
(Mohan Kornipati)
February 2, 2017, 7:21pm
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
}
}
}
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).