Search code examples
grailsgrails-plugin

unresolved classes from installed plugin


I am developing a custom plugin where is make use of groovys HTTPbuilder everything works fine when i run the plugin independently during tests(both manual and integration tests) However when i package and install the plugin in another app i get the following errors when running the app

unable to resolve class groovyx.net.http.HTTPBuilder
unable to resolve class groovyx.net.http.ContentType

I guess this has to do with dependency resolution but i do not know exactly what and why


Solution

  • Looks like you did not specify to the plugin to include HTTPBuilder when it is deployed. In BuildConfig.groovy you can specify your plugins like so:

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or         
        build : 'lib/http-builder.jar' //If you are manually including the http builder jar
    }
    plugins {
        build: ':joda-time:1.1'
        test ':fixtures:1.0.RC1.SNAPSHOT',
        ':spock:0.4-groovy-1.7-SNAPSHOT'
    }
    

    Here is a good link