Overriding the built-in Grails library?

The Grails "render" plugin uses org.xhtmlrenderer. Grails itself comes bundled with org.xhtmlrenderer: core-renderer: R8, which apparently from the dependency report is used by grails-docs.

There is a bug in this version of xhtmlrender which conflicts with twitter bootstrap and which is only committed to the github repository. I created this new version and installed it successfully via maven, but for the life of me I can't use the "render" plugin. I even tried to create my own version of the render plugin, but that doesn't work and according to the report "rendering" the dependency doesn't even depend on org.xhtmlrenderer: core-renderer: R8.

In BuildConfig.groovy I've tried (among many, many others):

inherits("global") {
        // specify dependency exclusions here; for example, uncomment this to disable ehcache:
        // excludes 'ehcache'
        excludes 'core-renderer-M8', 'org.xhtmlrenderer', 'core-renderer'
    }

      

and

compile 'org.xhtmlrenderer:flying-saucer-core:9.0.1-custom' 
runtime 'org.xhtmlrenderer:flying-saucer-core:9.0.1-custom'

      

to no avail.

How can I get a "render" to use my own assembly org.xhtmlrenderer? Is there a trick for making a local version of the "render" plugin and adding the exception and dependency information I tried in the BuildConfig.groovy project to the BuildConfig.groovy plugin?

+3


source to share


1 answer


What you need to do is exclude grails-docs from the inherited global dependencies and then add it separately, excluding xhtmlrenderer (although it looks like it's just the package name and you need to exclude the kernel-gravy). This will allow you to specify your own version of the library.



grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        excludes 'grails-docs'
    }

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
        // runtime 'mysql:mysql-connector-java:5.1.24'
        build('org.grails:grails-docs:2.3.7') {
            excludes 'flying-saucer-core'
        }
    }
}

      

+5


source







All Articles