Search code examples
grailsbuild-dependencies

grails 1.3.9 dependency issue: loading mail-1.4.3.jar as a plugin?


trying to get the code for a legacy system compiling (grails 1.3.9) and I've hit a barrier when it tried to install the mail-1.0.1 plugin. Seems that this succeeds but then then proceeds to try to install the mail-1.4.3.jar as a plugin and fails roling back mail 1.0.1. I've done the google thing and there is only a single reference (bug report) which has been of no help

Could the repositories be causing it?

Here is the specific build error

------------------------------------------
grails create-constraint
   [delete] Deleting directory /home/blake/.grails/1.3.9/projects/egrants-grails-1.3.9/resources
Installing zip /home/blake/.ivy2/cache/org.grails.plugins/mail/zips/mail-1.0.1.zip... ...
    [mkdir] Created dir: /home/blake/.grails/1.3.9/projects/egrants-grails-1.3.9/plugins/mail-1.0.1
    [unzip] Expanding: /home/blake/.ivy2/cache/org.grails.plugins/mail/zips/mail-1.0.1.zip into /home/blake/.grails/1.3.9/projects/egrants-grails-1.3.9/plugins/mail-1.0.1
Installed plugin mail-1.0.1 to location /home/blake/.grails/1.3.9/projects/egrants-grails-1.3.9/plugins/mail-1.0.1. ...
Resolving plugin JAR dependencies ...
Plugin mail-1.0.1 installed
Plugin /home/blake/.ivy2/cache/javax.mail/mail/jars/mail-1.4.3.jar is not a valid Grails plugin. No plugin.xml descriptor found!
   [delete] Deleting directory /home/blake/.grails/1.3.9/projects/egrants-grails-1.3.9/plugins/constraints-0.6.0
   [delete] Deleting directory /home/blake/.grails/1.3.9/projects/egrants-grails-1.3.9/plugins/mail-1.0.1

application.properties

#Grails Metadata file
#Tue May 27 22:06:43 EST 2014
app.grails.version=1.3.9
app.name=XXXX
app.servlet.version=2.4
app.version=1.XXXXX
plugins.codenarc=0.8.1
plugins.constraints=0.6.0
plugins.cxf=0.7.0
plugins.external-config-reload=1.2-SNAPSHOT
plugins.geb=0.4
plugins.gsp-arse=1.3
plugins.hibernate=1.3.9
plugins.jquery=1.8.3
plugins.jquery-ui=1.8.24
plugins.mail=1.0.1
plugins.nerderg-form-tags=1.3
plugins.rendering=0.4.3
plugins.spock=0.5-groovy-1.7
plugins.spring-security-core=1.0.1
plugins.tomcat=1.3.9

and the BuildConfig

// BuildCOnfig.groovy
grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes 'ehcache'
    }
    log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    repositories {
        grailsPlugins()
        grailsHome()
        grailsCentral()

        // uncomment the below to enable remote dependency resolution
        // from public Maven repositories
        //mavenLocal()
        mavenCentral()
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
        mavenRepo "http://repo.grails.org/grails/repo/"

        mavenRepo "http://repository.springsource.com/maven/bundles/release" 
        mavenRepo "http://repository.springsource.com/maven/bundles/external" 

    }
    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

        // runtime 'mysql:mysql-connector-java:5.1.5'
        runtime (group:'com.googlecode.ehcache-spring-annotations', name:'ehcache-spring-annotations', version:'1.2.0') {
            excludes(
                    [name: 'ehcache-core'],
                    [group: 'org.springframework'],
                    [group: 'org.slf4j']
            )
        }

    }
}

Solution

  • Turns out that letting it automatically resolve dependencies at compile time is a bad idea (TM). Manually installing every required plugin individually seems to have done the trick:

    grails install-plugin <plugin> <version>