micronaut-core still has transitive dependency on findbugs:jsr305 (com.google.code.findbugs:jsr305:3.0.2)
See original GitHub issueAs of Micronaut 2.1, there is still a transitive dependency on findbugs:jsr305
+--- io.micronaut:micronaut-inject:2.1.1
+--- org.slf4j:slf4j-api:1.7.26 -> 1.7.30
+--- javax.annotation:javax.annotation-api:1.3.2
+--- javax.inject:javax.inject:1
+--- io.micronaut:micronaut-core:2.1.1
| +--- org.slf4j:slf4j-api:1.7.26 -> 1.7.30
| +--- org.reactivestreams:reactive-streams:1.0.3
| \--- com.github.spotbugs:spotbugs-annotations:4.0.3
| \--- com.google.code.findbugs:jsr305:3.0.2
\--- org.yaml:snakeyaml:1.26
The transitive dependency results in Java Module System split-package issues:
error: the unnamed module reads package javax.annotation from both java.annotation and jsr305
error: module io.micronaut.core reads package javax.annotation from both jsr305 and java.annotation
error: module javafx.controlsEmpty reads package javax.annotation from both jsr305 and java.annotation
error: module javafx.graphicsEmpty reads package javax.annotation from both jsr305 and java.annotation
error: module javafx.baseEmpty reads package javax.annotation from both jsr305 and java.annotation
error: module java.annotation reads package javax.annotation from both jsr305 and java.annotation
error: module org.yaml.snakeyaml reads package javax.annotation from both jsr305 and java.annotation
error: module org.reactivestreams reads package javax.annotation from both jsr305 and java.annotation
error: module com.github.spotbugs.annotations reads package javax.annotation from both jsr305 and java.annotation
error: module jsr305 reads package javax.annotation from both jsr305 and java.annotation
error: module io.micronaut.inject reads package javax.annotation from both jsr305 and java.annotation
error: module org.slf4j reads package javax.annotation from both jsr305 and java.annotation
error: module javax.inject reads package javax.annotation from both jsr305 and java.annotation
I work around this with the Java Modularity Gradle Modules Plugin as follows:
patchModules.config = [
"java.annotation=jsr305-3.0.2.jar"
]
Note that the documentation is incorrect and says
The JSR-305 annotations library (com.google.code.findbugs:jsr305) is no longer a dependency (replaced by spotbugs-annotations). If you need this library you will need to add it manually.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Error:Conflict with dependency 'com.google.code.findbugs ...
Enforces Gradle to only compile the version number you state for all dependencies, no matter which version number the dependencies have stated. Share....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@aalmiray Micronaut 2.4 will let you exclude spot bugs using dependency exclusions to solve this issue
I’m also seeing 2 beans that are correctly loaded when I use
javax.inject.Singleton
but not when I usejakarta.inject.SIngleton
(simply changingjavax
tojakarta
in theimport
statement causes the bean not to load). Other beans are working withjakarta
, so I’m not sure what is happening. I’ll investigate further when I have time and post details.NOTE: I am using Micronaut Application Gradle Plugin v1.4.2