As of Gradle 0.9, the jst.web facet version in the eclipse plugin is hard-coded to 2.4. Here's a workaround:
eclipseWtp.whenConfigured { config ->
config.facets.each {
if (it.name == 'jst.web') {
it.version =
configurations.providedCompile.getAllDependencies().find{
it.group == 'javax.servlet' && it.name == 'servlet-api'
}.version
}
}
config.facets.unique()
}
Note that you'd better declare a providedCompile configuration dependency on javax.servlet:servlet-api or this is going to break. But you'd better do that anyway or your project isn't going to build.
Let me know if you know of a better way to do this.