8

Getting error in Scheduler Dependency i'm using grails4 : Anyone let me know correct dependency for scheduler

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

}

and also tried this:

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

}

Both are not able to compile:

grails run-app | Resolving Dependencies. Please wait...

| Running application...

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':compileGroovy'.

    org/quartz/JobExecutionContext

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 10s | Error Failed to start server (Use --stacktrace to see the full trace)

Michal_Szulc
  • 4,097
  • 6
  • 32
  • 59
Komal Prasad
  • 115
  • 1
  • 7

2 Answers2

14

You will need to add the quartz dependency explicitly in addition to the plugin as Gradle 5 stopped pulling in transitive dependancies. Also I'd suggest using the latest version (2.0.13 vs 2.0.1 which is quite old)

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
}
erichelgeson
  • 2,310
  • 1
  • 16
  • 24
1

We're using quartz in grails4 applications with:

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

here's the issue description on github: https://github.com/grails-plugins/grails-quartz/issues/107

Michal_Szulc
  • 4,097
  • 6
  • 32
  • 59