grails 1.3.9依赖问题:加载mail-1.4.3.jar作为插件?

时间:2014-05-28 03:00:03

标签: grails build-dependencies

尝试获取遗留系统编译的代码(grails 1.3.9),并且在尝试安装mail-1.0.1插件时遇到了障碍。似乎这成功但后来继续尝试安装mail-1.4.3.jar作为插件并且无法回滚邮件1.0.1。我已经完成了谷歌的事情而且只有一个参考(错误报告)没有帮助

存储库可能导致它吗?

以下是具体的构建错误

------------------------------------------
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

和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']
            )
        }

    }
}

1 个答案:

答案 0 :(得分:1)

事实证明,让它在编译时自动解决依赖关系是一个坏主意(TM)。单独手动安装每个必需的插件似乎已经成功了:

grails install-plugin <plugin> <version>