Grails 构建时包含在war中的未知插件

Grails 构建时包含在war中的未知插件,grails,grails-plugin,Grails,Grails Plugin,我注意到插件“svn-1.0.0.M1”在我每次构建时都会被拉到我的war中 我没有在buildConfig或application.properties中定义它 有人能解释为什么会这样吗?它是我其他插件中的一个依赖项吗 我正在使用Grails2.1.0 repositories { inherits true // Whether to inherit repository definitions from plugins grailsPlugins() grails

我注意到插件“svn-1.0.0.M1”在我每次构建时都会被拉到我的war中
我没有在buildConfig或application.properties中定义它

有人能解释为什么会这样吗?它是我其他插件中的一个依赖项吗

我正在使用Grails2.1.0

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

    grailsPlugins()
    grailsHome()
    grailsCentral()
    mavenCentral()
    mavenLocal()

    mavenRepo "http://snapshots.repository.codehaus.org"
    mavenRepo "http://repository.codehaus.org"
}
dependencies {
    // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
    runtime 'mysql:mysql-connector-java:5.1.20'
    runtime 'hsqldb:hsqldb:1.8.0.10'
}
plugins {
    build   ":tomcat:$grailsVersion", ":jbossas:1.0"
    runtime ":hibernate:$grailsVersion"
    compile ":spring-security-core:1.2.7.3",":geoip:0.2",":pretty-time:0.3",":profiler:0.4",":quartz:0.4.2"

    // Add plugins that MUST NOT go into production here
    if (Environment.current != Environment.PRODUCTION) {
        runtime ":build-test-data:2.0.3",":fixtures:1.1",":grails-melody:1.12"
    }       
}

谢谢

您可以在命令行上调用grails命令grails dependency report查看所有依赖项。

这来自grails melody和fixtures插件。正如Ian在评论中所说,Grails存在一个bug,其中标记为
exported=false
的插件依赖项被正确排除,但它的依赖插件却没有。较旧版本的发布插件依赖于svn插件,而较新版本依赖于rest client builder插件,因此这些插件可能会泄漏到包含它们的应用程序中

插件开发人员的解决方法是明确地依赖于发布插件的依赖项,并排除它们:

plugins {
   build(':release:2.2.0', ':rest-client-builder:1.0.3') {
      export = false
   }
}
而不仅仅是

plugins {
   build(':release:2.2.0') {
      export = false
   }
}
它由“release”插件使用,它是许多其他插件的构建时依赖项。在这些插件中,它应该被标记为非导出,这样它就不会被其他插件/应用程序作为可传递依赖项继承,但我知道在一些Grails版本中,在WAR中排除可传递依赖项存在一些问题。