在Grails中安装插件时的依赖性解决问题

时间:2013-03-13 01:59:03

标签: maven grails dependencies grails-plugin

所以我在Grails-app中安装的一些插件存在一些问题。看起来即使安装了一个插件,我也无法将包含它的包导入我的一个类中而不会出现“无法解析符号X”错误。所有插件都不是这种情况,仅适用于某些插件。

如果我尝试从某些插件导入包,我可以编译并运行我的应用程序而不会出现问题。关于为什么会这样,我真的很茫然。

作为理智检查......

对于给定的插件,我将任何mavenRepo依赖项或运行时/构建/编译插入到我的BuildConfig.groovy中,然后使用 grails install-plugin X 命令在我的项目中安装插件。然后我构建应用程序。

我的buildconfig文件的一部分如下。任何帮助或洞察将不胜感激。

repositories {
    inherits true // Whether to inherit repository definitions from plugins

    grailsPlugins()
    grailsHome()
    grailsCentral()

    mavenLocal()
    mavenCentral()

    // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
    //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://repository.springsource.com/maven/bundles/release"
    mavenRepo "http://repository.springsource.com/maven/bundles/external"
    mavenRepo "http://repository.springsource.com/maven/libraries/release"
    mavenRepo "http://repository.springsource.com/maven/libraries/external"
    //excel import plugin
    mavenRepo "http://repo.grails.org/grails/libs-releases/"
    mavenRepo "http://m2repo.spockframework.org/ext/"
    //joda time
    mavenRepo "http://repo.grails.org/grails/libs-releases/"
    mavenRepo "http://m2repo.spockframework.org/ext/"
    mavenRepo "http://m2repo.spockframework.org/snapshots/"
    //execel export plugin
    mavenRepo("http://maven.touk.pl/nexus/content/repositories/releases")

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

    // runtime 'mysql:mysql-connector-java:5.1.20'
     runtime 'mysql:mysql-connector-java:5.1.22'
}

plugins {
    runtime ":hibernate:$grailsVersion"
    runtime ":jquery:1.8.0"
    runtime ":resources:1.1.6"

    // Uncomment these (or add new ones) to enable additional resources capabilities
    //runtime ":zipped-resources:1.0"
    //runtime ":cached-resources:1.0"
    //runtime ":yui-minify-resources:0.1.4"

    build ":tomcat:$grailsVersion"

    //runtime (":excel-export:0.1.4")
    runtime ":database-migration:1.1"

    compile ':cache:1.0.0'
    compile ":searchable:0.6.4"
    compile ":spring-security-core:1.2.7.3"
    compile ":excel-import:1.0.0"
    compile ":excel-export:0.1.4"
    compile ":joda-time:1.4"


}

}

0 个答案:

没有答案