# Having Problems apply rewrite rules for jetty

**URL:** <https://discuss.gradle.org/t/having-problems-apply-rewrite-rules-for-jetty/4226>\
**Category:** Old Forum Archive\
**Created:** [January 9, 2015, 2:29pm UTC](https://discuss.gradle.org/t/having-problems-apply-rewrite-rules-for-jetty/4226 "2015-01-09T14:29:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Freisen](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@Kevin\_Freisen](https://discuss.gradle.org/u/Kevin_Freisen)\
**Post date:** [January 9, 2015, 2:29pm UTC](https://discuss.gradle.org/t/having-problems-apply-rewrite-rules-for-jetty/4226/1 "2015-01-09T14:29:00Z")

</div>

I’m having some problems attempting to apply some rewrite rules from a ‘jetty.xml’ file. Here’s what I got (pertaining to jetty – the war setup and everything is going fine):

‘’’ jettyRunWar.contextPath ‘’ jettyRunWar.jettyConfig = file(‘jetty.xml’) jettyRunWar {

additionalRuntimeJars = [file(‘jetty.xml’)] } ‘’’

And from ‘jetty.xml’ (which is in the root of that project): [https://gist.github.com/kfreisen/ca5e1974fe37448ba7e0](https://gist.github.com/kfreisen/ca5e1974fe37448ba7e0)

I’m getting this exception:

‘’’ Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Server

at org.mortbay.util.Loader.loadClass(Loader.java:91)

at org.mortbay.xml.XmlConfiguration.nodeClass(XmlConfiguration.java:224)

at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:187)

at org.gradle.api.plugins.jetty.JettyRunWar.applyJettyXml(JettyRunWar.java:121)

at org.gradle.api.plugins.jetty.AbstractJettyRunTask.startJettyInternal(AbstractJettyRunTask.java:201)

… 54 more ‘’’

I tried adding ‘‘org.eclipse.jetty:jetty-server:9.3.0.M0’’ as a runtime dependency, but that also did not seem to do anything. Any ideas?

---

<div class="post-metadata">

**Author:** ![bmuschko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/bmuschko/32/5458_2.png) [@bmuschko](https://discuss.gradle.org/u/bmuschko)\
**Post date:** [January 9, 2015, 6:44pm UTC](https://discuss.gradle.org/t/having-problems-apply-rewrite-rules-for-jetty/4226/2 "2015-01-09T18:44:00Z")

</div>

The [Gradle core Jetty plugin](http://www.gradle.org/docs/current/userguide/jetty_plugin.html) doesn’t allow for changing the version of Jetty that it comes with. You might want to use the [Gretty plugin](https://github.com/akhikhl/gretty) instead. It’s far more configurable and allows for changing the Jetty version.
