-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make c3p0 and HarikiCP dependency as provided scope #306
Comments
+1, thanks @zemian. As discussed in #294 (comment) ... HikariCP and c3p0 are currently in the Then, in the Quartz pom, put these database dependencies in the <dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>[2.3.0)</version>
<scope>provided</scope>
</dependency> In other words, users of Quartz will "provide" a compatible version of these dependencies if they need to interact with a database. Otherwise, these dependencies are kept local to Quartz, and won't transitively pollute any downstream dependency trees. |
This would be especially useful when vulnerabilities are reported against We could avoid needing to investigate vulnerabilities in libraries we have as dependencies but are not actually using. |
Big +1 for this |
@ilgrosso Correct me if I'm wrong... but the problem I can see with this approach: what if someone:
It'll lead to classpath conflict in runtime IIUC. |
I'd even say that the better solution would be to emulate a Java 9/OSGi non-exported module by shading the HikariCP dependency into some obscure package like |
@PawelLipski not sure to follow, but I would presume that Quartz's code is using HikariCP only through standard's Consider that in Apache Syncope we are simply excluding this transitive dependency and carrying over: https://github.com/apache/syncope/blob/master/pom.xml#L1284-L1294 If this current issue is fixed, we'll remove the |
Looks there's at least one explicit reference to Hikari classes in non-test code: https://github.com/quartz-scheduler/quartz/blob/master/quartz-core/src/main/java/org/quartz/utils/HikariCpPoolingConnectionProvider.java#L20 As mentioned in the comment above... in the Apache Syncope project, are you using the Hikari-dependent functionality of Quartz? In our project we're just using akka-quartz-scheduler which AFAIK doesn't need anything related to SQL-backed Quartz data sources, so most likely the exclusion you recommend should be enough (let me check actually...). |
Instead of shading, perhaps a better split is to create a new When a user needs DB connectivity in conjunction with Quartz, they can explicitly add a dependency on |
I think for now, the easiest solution is simply make HikariCP as provided scope. For other suggestions, we might consider them as part of #416. |
The HarikiCP has been made "provided" scope with #418, but to make C3P0 also provided scope then it be more intrusive. We would need to at least provide a local provider that use direct JDBC connection as default. Then we can make C3P0 as "provided" scope. |
Also, I have now added a doc on how to setup these connection provider properly, including the workaround of setup HarikiCP with maven exclude with the latest release. https://github.com/quartz-scheduler/quartz/wiki/How-to-Use-DB-Connection-Pool |
How so? I quickly grep'ed the source tree and it looks like c3p0 is only referenced in a small handful of files, no more than HikariCP afaict. A good first step is putting both HikariCP and c3p0 in the |
What I mean "intrusive" is that "c3p0" has been part of quartz dep and package for a long time. Folks just change their quartz.properties and they get the db conn pull right a way. Making it provided scope will break people's upgrade unless they add c3p0 explicitly. Hence I say "intrusive". In fact, if we don't include c3p0, Quartz won't able to get any connection since there is no default iml. I don't disagree with the request. Just that prob need a better doc and provide something default. As the need for "quartz-db" is not 100% necessary if we going to make the lib in "provided" scope already. |
HikariCP-java7 & Spring Actuator depend on incompatible version of Micrometer. Just disabled HikariCP-java7:
|
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This is definitely still relevant as far as I can tell. |
we have a related issue: Unfortunatelly Quartz 2.3.2 has requires hikariCP in a lower version range, than we have.
Thus, quartz does not start in an OSGI container anymore. Question: In OSGI this would be achieved with:
Or could you just support latest hikariCP versions >=5.0.0? |
Build system is being replaced with gradle, and have included generation of maven poms. the dependencies (such as Hikari) are ending up declared as "runtime" scope in the pom. |
Seems https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
So when you publish artifacts to Maven Central we still will suffer from unnecessary dependencies! People asked for
|
If I understand the solution correctly upstream just said: the feature won't be implemented. Nothing wrong, just state it clearly )) Probably FAQ should have some example about listing & excluding extra dependencies, and how their presence or absence influences functionality. |
woah, just realized when opening PR that I accidentally closed this a few hours ago. Intention is to properly resolve this but looking for validation from others around expectations. This is what currently gets produced:
|
There are exclusions for SQL pool managers - what was asked by participants. As for Slf4j it seems OK to have https://www.slf4j.org/faq.html
I'm not sure why |
Thanks. I think the XML stuff might be able to be "provided" - it's only used if you use certain features of Quartz. Regarding Jakarta, there has to be another release of quartz (2.5.0) in the very near future to deal with all the jakarta renaming - affects JTA, Java Mail, and other things that Quartz uses. |
Quartz 2.4.0 RC1 is released to maven central and on GitHub. It would be nice if a few users test out the new pom which declares several dependencies differently than in past releases (using "provided" scope). Before making the full/official release it would be good to know this is working as expected for users. You can add the dependency with this version number: org.quartz-scheduler quartz 2.4.0-rc1 |
See #294 for more discussion as well.
The text was updated successfully, but these errors were encountered: