【问题标题】:Quartz not working in Grails4, Issue in dependency not able to compileQuartz 在 Grails4 中不起作用,依赖问题无法编译
【发布时间】:2020-07-23 10:08:55
【问题描述】:

在我使用 grails4 的调度程序依赖中出现错误: 任何人都让我知道调度程序的正确依赖关系

dependencies {
compile "org.grails.plugins:quartz:2.0.1"

}

也试过这个:

dependencies {
compile "com.agileorbit:schwartz:1.0.1"

}

两者都无法编译:

grails 运行应用程序 |解决依赖关系。请稍候...

|正在运行应用程序...

FAILURE:构建失败并出现异常。

  • 出了什么问题: 任务 ':compileGroovy' 执行失败。

    org/quartz/JobExecutionContext

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。

  • 通过https://help.gradle.org获得更多帮助

在 10 秒内构建失败 |错误无法启动服务器(使用 --stacktrace 查看完整跟踪)

【问题讨论】:

    标签: grails grails-plugin grails-4


    【解决方案1】:

    除了插件之外,您还需要显式添加石英依赖项,因为 Gradle 5 停止引入传递依赖项。另外我建议使用最新版本(2.0.13 与 2.0.1 相当旧)

    buildscript {
        dependencies {
            classpath 'org.grails.plugins:quartz:2.0.13' // Needed to compile *Job classes
        }
    }
    
    dependencies {
        compile 'org.grails.plugins:quartz:2.0.13'
        compile 'org.quartz-scheduler:quartz:2.2.1' // Is not pulled in by default
    }
    

    【讨论】:

      【解决方案2】:

      我们在 grails4 应用程序中使用石英:

      dependencies {
          //...
          compile("org.quartz-scheduler:quartz:2.2.3") {
              exclude group: 'slf4j-api', module: 'c3p0'
          }
          compile ('org.grails.plugins:quartz:2.0.13') 
      }
      

      这是github上的问题描述:https://github.com/grails-plugins/grails-quartz/issues/107

      【讨论】:

        猜你喜欢
        • 2019-02-06
        • 1970-01-01
        • 2019-11-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-06
        • 1970-01-01
        • 2022-07-08
        相关资源
        最近更新 更多