grails / grails-forge

This is Grails project creator. Grails projects may be created using the browser interface, Command Line, or via CURL.
Apache License 2.0
3 stars 9 forks source link

Quartz feature does not work #325

Closed matrei closed 2 months ago

matrei commented 3 months ago

Description

There is a compilation error when compiling apps that has added the quartz feature: Unable to load class 'org.quartz.JobExecutionContext'

Related: https://github.com/grails-plugins/grails-quartz/issues/107#issuecomment-575951471

Adding:

implementation("org.quartz-scheduler:quartz:2.3.2") {
    exclude group: 'slf4j-api', module: 'c3p0'
}

will make the quartz plugin work.

This is because the grails-quartz plugin does not put the org.quartz-scheduler:quartz on the compileClasspath but only on the runtimeClasspath of grails apps.

./gradlew dI --dependency org.quartz-scheduler:quartz --configuration compileClasspath
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

> Task :dependencyInsight
No dependencies matching given input were found in configuration ':compileClasspath'
./gradlew dI --dependency org.quartz-scheduler:quartz --configuration runtimeClasspath

> Task :dependencyInsight
org.quartz-scheduler:quartz:2.3.2 (selected by rule)
  Variant runtime:
    | Attribute Name                 | Provided     | Requested    |
    |--------------------------------|--------------|--------------|
    | org.gradle.status              | release      |              |
    | org.gradle.category            | library      | library      |
    | org.gradle.libraryelements     | jar          | jar          |
    | org.gradle.usage               | java-runtime | java-runtime |
    | org.gradle.dependency.bundling |              | external     |
    | org.gradle.jvm.environment     |              | standard-jvm |
    | org.gradle.jvm.version         |              | 11           |

org.quartz-scheduler:quartz:2.2.3 -> 2.3.2
\--- org.grails.plugins:quartz:2.0.13
     \--- runtimeClasspath
matrei commented 3 months ago

Fixed by grails/grails-quartz#125