Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Dynamic Servlet Registration

Sorry for the previous message.
It was sent from nabble and code fragments were lost in transit.

Here the full message:

Ken Siprell wrote
> ... Unfortunately, the Grails Jetty plugin uses version 7.6.0. 

You can alter this. Use standard Grails features for build dependencies.

1. conf/BuildConfig.groovy. add jetty 8 jars to dependencies closure:

dependencies {
        def jettyVersion = "8.1.13.v20130916"
        ) {
            excludes "commons-el","ant",
            excludes "xercesImpl","xmlParserAPIs", "servlet-api"
            excludes "mail", "commons-lang"
            excludes([group: "org.eclipse.jetty.orbit", name:
                     [group: "org.eclipse.jetty.orbit", name:
                     [group: "org.eclipse.jetty.orbit", name:
                     [group: "org.eclipse.jetty.orbit", name:

2. conf/BuildConfig.groovy. to remove jetty 7 jars added from grails-jetty
plugin, add to plugins closure:

plugins {
        // strip jetty7 plugin jars from war
            excludes "jetty-http", "jetty-server", "jetty-webapp",
            excludes "jetty-security", "jetty-websocket",
"jetty-continuation", "jetty-jndi"

3. conf/BuildConfig.groovy. to remove jetty-7 jars from war file, add
grails.war.resources closure:

grails.war.resources = { stagingDir, args ->
    delete(file: "${stagingDir}/WEB-INF/web-jetty.xml")
    delete(file: "${stagingDir}/WEB-INF/jetty-all-7.6.0.v20120127.jar")

Also you can add to scripts/_Events.groovy handler for CreateWarStart event:

eventCreateWarStart = { warName, stagingDir ->
    println "Removing Jetty jars"
    Ant.delete {
        fileset(dir:"${stagingDir}/WEB-INF/lib") {

Hope this helps.

Best regards,
    Igor Poteryaev

View this message in context:
Sent from the Jetty User mailing list archive at

Back to the top