2

我有一个使用以下方法编写的艰巨任务:

grails create-script my-script

我正在使用我的构建配置中的插件中的一些代码:

compile ":csv:0.3.1"

但是,当我执行我的 gant 脚本时,它不在类路径上。我在依赖项中使用了另一个依赖项,如下所示:

dependencies {
    build 'com.atlassian.jira:jira-rest-java-client-api:2.0.0-m25'
    build 'com.atlassian.jira:jira-rest-java-client-core:2.0.0-m25'
}

加载在类路径上。但是,我的插件代码不是。如何让插件代码与 gant 脚本一起使用?

更新:

这是我的脚本的开始方式:

includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsClasspath")
includeTargets << grailsScript("_GrailsCompile")

target(main: "Creates JIRA tasks for Content Developers based on given lesson file.") {
    depends(compile)
    ....
}
4

1 回答 1

1

对此的解决方法是使用以下内容:

includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsBootstrap")

target(main: "Creates JIRA tasks for Content Developers based on given lesson file.") {
    depends( bootstrap )
    ...
}

但是,我在 spring 框架版本 2.5.6 中有一个传递依赖,这很混乱。我得到以下信息:

org.codehaus.groovy.grails.commons.spring.GrailsApplicationContext.getEnvironment()Lorg/springframework/core/env/ConfigurableEnvironment;

解决方法如下:

dependencies {
    build( 'com.atlassian.jira:jira-rest-java-client-api:2.0.0-m25' ) {
        excludes([group: "org.springframework", name:"spring-context", version:"2.5.6"],
                 [group:"org.springframework", name:"spring-beans", version:"2.5.6"],
                 [group:"org.springframework", name:"spring-core", version:"2.5.6"])
    }
    build('com.atlassian.jira:jira-rest-java-client-core:2.0.0-m25') {
        excludes([group: "org.springframework", name:"spring-context", version:"2.5.6"],
                 [group:"org.springframework", name:"spring-beans", version:"2.5.6"],
                 [group:"org.springframework", name:"spring-core", version:"2.5.6"])
    }
}
于 2013-09-08T22:09:47.117 回答