Closed jponge closed 11 months ago
Aren't you applying some dep exclusions?
Looking at Maven dep tree of io.smallrye:smallrye-context-propagation
, I can see that it transitively brings in Jakarta annotations via CDI dependency:
[INFO] io.smallrye:smallrye-context-propagation:jar:2.1.0
[INFO] +- org.eclipse.microprofile.context-propagation:microprofile-context-propagation-api:jar:1.3:compile
[INFO] +- org.eclipse.microprofile.config:microprofile-config-api:jar:3.0.2:compile
[INFO] +- io.smallrye:smallrye-context-propagation-api:jar:2.1.0:compile
[INFO] +- io.smallrye:smallrye-context-propagation-storage:jar:2.1.0:compile
[INFO] +- jakarta.enterprise:jakarta.enterprise.cdi-api:jar:4.0.1:provided
[INFO] | +- jakarta.enterprise:jakarta.enterprise.lang-model:jar:4.0.1:provided
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:2.1.1:provided
[INFO] | +- jakarta.el:jakarta.el-api:jar:5.0.0:provided
[INFO] | +- jakarta.interceptor:jakarta.interceptor-api:jar:2.1.0:provided
[INFO] | \- jakarta.inject:jakarta.inject-api:jar:2.0.1:provided
[INFO] \- org.jboss.threads:jboss-threads:jar:3.4.2.Final:compile
[INFO] +- org.jboss.logging:jboss-logging:jar:3.5.0.Final:compile
[INFO] \- org.wildfly.common:wildfly-common:jar:1.5.0.Final:compile
Ah, now I see, the CDI API dep is now marked as provided
which is why you aren't getting it.
This was changed by @radcortez in this commit. I am not sure if that was intentional or a mistake?
FTR this used to be compile
dep and I don't see why it couldn't stay that way but maybe there was an issue with proliferating specific CDI version this way :shrug:
We usually mark the dependencies coming from Jakarta as provided because most of our components will be used in a runtime that already provides these dependencies.
On the other hand, we have components that can be used independently. In this case, SmallRye Config is not shipping the jakarta annotations dependency which adds @Priority
. I could add it there, or each project can also do it manually.
On the other hand, we have components that can be used independently. In this case, SmallRye Config is not shipping the jakarta annotations dependency which adds @Priority. I could add it there, or each project can also do it manually.
I wouldn't explicitly add jakarta annotations dep - anyone missing those is likely to miss others that formerly transitively shipped with CDI dep. I'd rather vote for Mutiny adding the dependency if that's not too much of a problem :)
I can add that to mutiny-smallrye-context-propagation
, let me have a look
Where do I find jakarta.enterprise.util.AnnotationLiteral
?
Adding jakarta.annotation:jakarta.annotation-api
isn't enough
You need the CDI API: jakarta.enterprise:jakarta.enterprise.cdi-api:4.0.1
.
Thanks @Ladicek, I've added it as a provided
dependency and it'll fix mutiny-smallrye-context-propagation
Upgrading from 2.0.0 to 2.1.0 in Mutiny yields class not found exceptions in the
mutiny-smallrye-context-propagation
module: