Search code examples
gradlegretty

Upgrade Jetty version to 9.4.8 in build.gradle


I am currently using the following gretty configuration in build.gradle:

gretty {
  servletContainer = 'jetty9'
}

I want to upgrade the jetty version to 9.4.8. From a quick search I found that jetty9 stands for the version Jetty 9.2.22.v20170606 (from: http://akhikhl.github.io/gretty-doc/Switching-between-servlet-containers.html). I couldn't anything on how to upgrade to jetty version 9.4.8. Could someone please help.


Solution

  • Yeah, from this doc, you can configure gretty to use 'jetty9.4' (jdk 8 only) instead of jetty9.

    In the latest v2.0.0 release, plugin will work with jetty9 of 9.2.22.v20170606 and jetty9.4 of v9.4.6.v20170531, respectively.(ref)

    jetty9_version=9.2.22.v20170606
    jetty94_version=9.4.6.v20170531
    

    You can PR for jetty94_version.

    [updated]

    I have created a sample project using Spring MVC with Jetty 9.4.8 particularly in this commit.

    [edit note]

    Please use 'jetty9.4' (instead of 'jetty94') - Refer to this github comment for more info