> So, jax-rs requires jaxb when building. Building the api? Building jersey? both?
Building the API for sure - I'm not sure about Jersey, but I would think that it would also require the dependency if it is implementing the Link (and especially the Link.JaxbAdapter inner class) API.
> Does the resulting api binary have a dependency on jaxb? If it does, then that's a problem.
Yes it does. But users should not notice the dependency unless they explicitly use the Link class. Since the vast majority of RESTful WS function is available without using that class, I would claim that it is an optional dependency.
> I'm not clear on this "Link" class. I guess this gets back to the previous question. If the dependency on jaxb is soft and dynamic, and the only time that the dependency is required is when this "Link" class is utilized, then we're getting closer to workable solution.
It is certainly a hard dependency from the Link.JaxbAdapter inner class. It is not soft/dynamic from the perspective that it is loaded reflectively and handled gracefully if not available. If a user attempts to use this class without having Jakarta XML Binding in their classpath, they will see a nasty ClassNotFoundException/NoClassDefFoundError like Scott reported.
> Is this "Link" class marked "optional" as part of the API?
The javadoc has the wording I mentioned previously. Is there a more official way to mark the class as "optional"?
> Does the TCK test this "Link" class and are those tests marked optional?
The TCK does use the Link class, and afaict those tests are not currently marked optional.
In the Jakarta RESTful WS spec, there are requirements for implementations when other Jakarta APIs are available. For example, an implementation is required to supply a built-in JSON-B provider if the JSON-B APIs are available. I don't know how (or if) this is tested in the TCK, but IMO we should use a similar mechanism to test the Link class - basically something like JUnit's "assume" method - i.e. assumeThat(canLoadJakartaXMLBindingAPIs()); That should prevent the test from failing if the environment does not have XML Binding, but should perform the test if it does.
Hope this helps,
Andy