Closed pbelousov closed 11 months ago
Guice 6 works with both javax and jakarta annotations (and includes both dependencies)
Could you please describe:
Most likely, in your project jakarta.inject 1.0.5 used instead of 2.0.1, but I want to understand how this could happen.
And, of course, I don't mind to fix direct jakarta inject usages, just need to understand first
Thank you for blazingly fast response!
How you setup guicey (direct dependency or with BOM)?
We have a direct dependency.
What build tool you use (maven or gradle)?
Maven
Most likely, in your project jakarta.inject 1.0.5 used instead of 2.0.1
That's absolutely correct, and that's because Dropwizard 3.x uses 1.0.5: https://github.com/dropwizard/dropwizard/blob/v3.0.0/dropwizard-dependencies/pom.xml#L42C33-L42C33
Thank you for clarification! I see now, its all because of dropwizard BOM forcing this version.
In guicey BOM I'm forcing correct version to override dropwizard default.
As a quick fix you can force jakarta.inject-api 2.0.1 the same way (just override version in dependencyManagement). This would be completely legal as dropwizard use jakarta 1.0 as a replacement for javax artifact, but guice brings in javax.inject:javax.inject
and so all javax annotations would be present in classpath.
I will deal with pr a bit later (to avoid such problems). But I would like to wait a bit with release as new dropwizard version could be released soon.
Version
6.2.0
introduced a couple ofjakarta
imports that break applications at runtime.