grails插件的依赖关系

时间:2012-09-07 11:37:17

标签: grails grails-plugin

我正在编写一个依赖于Quartz插件的Grails插件,即安装我的插件的应用程序也必须安装Quartz插件。为了强制执行此要求,我将以下内容添加到插件的描述符

def dependsOn = [quartz: '0.4.2']

但是,当我运行grails package-plugin时,我收到错误

Error: The following plugins failed to load due to missing dependencies: [quartzJobStats]
- Plugin: quartzJobStats
   - Dependencies:
       ! quartz (Required: 0.4.2, Found: Not Installed) [INVALID]

我应该如何指定(插件)插件的依赖项?

1 个答案:

答案 0 :(得分:1)

不要在Grails 2.0+中使用dependsOn,在BuildConfig.groovy中添加依赖项

plugins {
   build(':release:2.0.4', ':rest-client-builder:1.0.2') {
      export = false
   }
   compile ":quartz:0.4.2"
}

或者这个使用最新的:

compile ":quartz:1.0-RC2"