jakartaee / jakartaee-api

jakartaee-api
Other
39 stars 42 forks source link

Add jakarta.xml.bind-api to jakartaee-bom #103

Closed grossws closed 2 years ago

grossws commented 3 years ago

This dependency is required on JDK11+ since JDK no longer contain these classes because JEP-320 was merged. JDK 9-10 had them in module which needed to be added manually, see StackOverflow question for example.

Fixes #101

kwsutter commented 3 years ago

Okay, now I understand what you are attempting to do. Thank you! But, I still have questions. In Jakarta EE 9, we recognized the absence of JAXB (XML Binding) in JDK 11. We determined that we optionally required XML Binding for JAX-RS (Restful Services), so we identified it as an optional dependency in our POM and BOM files going forward.

But, in Jakarta EE 8, since JAXB (XML Binding) was part of JDK 8, we didn't consider it optional -- it was just provided by the JDK. It was considered a compile-time dependency only.

So, I guess I need education on how this BOM update would be used. Unfortunately, we don't have any test cases for the BOM (separate issue), so I'm not sure if this change could affect existing users of the 8.0.x BOM. Although your PR looks benign and safe, I'm just not sure of the impact of including this dependency in the BOM file.

grossws commented 3 years ago

I intended the PR for library/framework authors who build their work on Jakarta EE 8 but targets JDK 11+. In my case we have internal partially EE7-compatible microframework with Jetty/RESTEasy/Weld stack so I had to align all platform APIs on relevant EE versions with a lot of exclusions (since RESTEasy and Weld used their own packages for EE APIs).

So my goal here is to simplify dependencies for downstream library/framework authors and have one source of truth for all EE-related API versions. Application developers who builds against EE 8 remain unaffected since they use jakartaee-api as dependency with bunch of provided/optional deps to compile against.

If someone used already released Jakarta EE 8 BOM and targeted jdk9+ they likely had JAXB API in dependencyManagement already and adding it to BOM shouldn't affect them negatively since it would be shadowed by direct dependency in dependencyManagement. It's could be more complex in case of Gradle which will choose higher and not nearest dependency in graph.