Java SE JSR 250 annotations module renamed to java.xml.ws.annotation?

Claes Redestad claes.redestad at oracle.com
Mon Feb 13 14:08:09 UTC 2017


Hi Guillaume,

On 02/13/2017 02:34 PM, Guillaume Smet wrote:
> At the end, I'm wondering if these classes shouldn't be part of the default
> set of classes exposed without requiring an --add-modules option.

one of the main reasons why java.xml.ws.annotations is not resolved
by default is that there are many projects out there with dependencies
on various JSR 305 implementations[1], which is a non-final and dormant
JSR which happen to clash with JSR 250 by adding more annotations to
the same packages... thus if java.xml.ws.annotations is resolved at
boot time using --add-modules then any project with a dependency on
one of the rogue JSR 305 implementations is likely to break[2].

A perhaps less fragile alternative here is to not depend on the
JDK-bundled java.xml.ws.annotations at all but instead depend directly
on the JSR 250 API as published by the JCP[3] as an explicit dependency.

Hope this helps!

/Claes

[1] https://jcp.org/en/jsr/detail?id=305
[2] See http://openjdk.java.net/jeps/261#EE-modules for more info
[3] E.g.: 
https://mvnrepository.com/artifact/javax.annotation/jsr250-api/1.0


More information about the jigsaw-dev mailing list