From 93448cf256a9a1fca1d88d4f859530c8ff24dd1f Mon Sep 17 00:00:00 2001 From: Nick Robison Date: Wed, 7 May 2025 15:22:04 -0700 Subject: [PATCH] Update dependency scope for DB backends When upgrading a project from Quartz 2.3.2 to 2.5.0 we ran into the following error: ``` Exception in thread "main" java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/ComboPooledDataSource at org.quartz.utils.C3p0PoolingConnectionProvider.initialize(C3p0PoolingConnectionProvider.java:187) at org.quartz.utils.C3p0PoolingConnectionProvider.(C3p0PoolingConnectionProvider.java:106) at com.rms.mapping.system.scheduler.QuartzSchedulerManager$.init(QuartzSchedulerManager.scala:225) at com.rms.mapping.system.scheduler.QuartzSchedulerManager$.apply(QuartzSchedulerManager.scala:201) ``` Looking at the Gradle build, it look like the `c3p0` dependency is declared as `implementation` which means it's not exposed on the runtime class path. While the workaround from #1310 is sufficient if these types are exposed in the library API then it seems to make sense to change their declaration scope. This PR updates the dependency declaration to restore the behavior of the 2.3.x library. If these dependencies were intentionally hidden then perhaps a comment in the release notes or the README would be helpful? Signed-off-by: Nick Robison --- quartz/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quartz/build.gradle b/quartz/build.gradle index 10d732911..0dbe4c25a 100644 --- a/quartz/build.gradle +++ b/quartz/build.gradle @@ -19,8 +19,8 @@ dependencies { implementation "org.slf4j:slf4j-api:$slf4jVersion" runtimeOnly "org.slf4j:slf4j-log4j12:$slf4jVersion" - implementation "com.mchange:c3p0:$c3p0Version" - implementation "com.zaxxer:HikariCP:$hikaricpVersion" + api "com.mchange:c3p0:$c3p0Version" + api "com.zaxxer:HikariCP:$hikaricpVersion" compileOnly "jboss:jboss-common:$jbossVersion" compileOnly "jboss:jboss-minimal:$jbossVersion" compileOnly "jboss:jboss-system:$jbossVersion" @@ -77,4 +77,4 @@ processResources { filesMatching('**/quartz-build.properties') { expand([version: project.version, fullname: project.fullname, name: project.name]) } -} \ No newline at end of file +}