In our open source constraint solver (OptaPlanner), I want to use @NonNull
to make it more Kotlin friendly and clearer to use from Java, too.
spring-core
already uses @NonNull
, for example in this code. They effectively state for every method parameter if it's nullable or not, as explained here.
Which maven/gradle dependency should I use to have the class javax.annotation.Nonnull
in my classpath? Which one do the spring guys use? For example, I don't see the findbugs JSR-305 jar in their dependency list.
(And can I have it as an optional dependency to avoid bloating my user's classpath?)
I would say that https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305 should be your artifact of choice for this, as it's probably the most commonly used and properly maintained.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With