Hi guys. I lead a popular open source Java library...
# server
g
Hi guys. I lead a popular open source Java library that's often used from Kotlin (see OptaPlanner.org). Those users are asking for nullability annotations on our public API, which we are happy to provide. However, which dependency do I add to maven/gradle to get those? I don't want java users of optaplanner that do "mvn dependency:tree" to see that optaplanner drags in android, jetbrains or findbugs jars.
m
what about JSR-305
javax.annotation
?
☝️ 1
🤔 1
g
@Martin Jinoch What's the maven GAV dependency for a jar that contains those annotations?
And is there any way to avoid making it a compile scoped dependency in the optaplanner-core pom?
More specifically, what's the canonical GAV for javax.annotation? (and why is there no jakarta standarization of it in the pipeline - is it dead?)
m
I think it is the
javax.annotation-api
jar, but honestly I don't know the state of that 'project'. It just seems to me like the first choice I would investigate for your case.
g
I have. There doesn't seem to be a canonical jar, a year ago, so I didn't go through with improving kotlin support.
As far as I can tell, the situation hasn't changed?
m
the 'natural successor' is probably
jakarta.annotation-api
g
As far as I can tell by downloading jarakta.annotations-api, that doesn't include the nullability annotations, only some sql related ones.
Sorry to be a downer here :)
m
really? then my suggestion wasn't very good, indeed. sorry for that
g
No worries, it's better to try and fail than not to try to help :)
j
You seem to be able to use the jetbrains annotations too. That one I think has a jar with those.
You can check the java interop docs for the list of annotations
g
I love IntelliJ, but I 'd like to avoid having optaplanner-core depend on jetbrains-annotations (it shows up in a user's mvn depenency:tree), to 1) avoid bloating our lightweight engine and 2) to avoid alienating eclipse, netbeans and vscode users. We don't want to pick sides in the IDE battle. We'd still love to improve kotlin support, if it doesn't impact our java users.