Gretty version 1.1.5+ automatically injects the following variables into project.ext of your project:

project.ext {
  grettyVersion = Externalized.getString('grettyVersion')
  jetty7Version = Externalized.getString('jetty7Version')
  jetty7ServletApi = Externalized.getString('jetty7ServletApi')
  jetty7ServletApiVersion = Externalized.getString('jetty7ServletApiVersion')
  jetty8Version = Externalized.getString('jetty8Version')
  jetty8ServletApi = Externalized.getString('jetty8ServletApi')
  jetty8ServletApiVersion = Externalized.getString('jetty8ServletApiVersion')
  jetty9Version = Externalized.getString('jetty9Version')
  jetty9ServletApi = Externalized.getString('jetty9ServletApi')
  jetty9ServletApiVersion = Externalized.getString('jetty9ServletApiVersion')
  tomcat7Version = Externalized.getString('tomcat7Version')
  tomcat7ServletApi = Externalized.getString('tomcat7ServletApi')
  tomcat7ServletApiVersion = Externalized.getString('tomcat7ServletApiVersion')
  tomcat8Version = Externalized.getString('tomcat8Version')
  tomcat8ServletApi = Externalized.getString('tomcat8ServletApi')
  tomcat8ServletApiVersion = Externalized.getString('tomcat8ServletApiVersion')
}

These variables are always up-to-date and correspond to library versions used by Gretty itself.

You can rely on these variables, when adding version-sensitive components, for example:

dependencies {
  gretty "org.apache.tomcat:tomcat-dbcp:$tomcat8Version"
}

Note that changing the values of version variables is possible, but not recommended. Gretty will ignore such changes and use the versions supplied to Gretty at compile time (of Gretty Gradle plugin).