Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK11 Compatibility? JAXB > 2.3.x? #58

Closed
mb-3000 opened this issue Oct 17, 2018 · 7 comments
Closed

JDK11 Compatibility? JAXB > 2.3.x? #58

mb-3000 opened this issue Oct 17, 2018 · 7 comments
Labels
not an issue Something to do with a documentation, examples, etc
Milestone

Comments

@mb-3000
Copy link

mb-3000 commented Oct 17, 2018

Hi,

I've been using this plugin in my jaxb projects and wondered if there was going to be an upgraded version to support 2.3.x JAXB and JDK11.

When using your plugin in a gradle build on JDK11 release I get a few warnings I have managed to track down to your plugin.

Errors occurred while build effective model from /Users/michaelbennet/.gradle/caches/modules-2/files-2.1/com.sun.xml.bind/jaxb-core/2.2.11/db0f76866c6b1e50084e03ee8cf9ce6b19becdb3/jaxb-core-2.2.11.pom:
    'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} in com.sun.xml.bind:jaxb-core:2.2.11

I think its to do with your dependency on jaxb but it could also be your use of the ${tools.jar} element in your maven script that is being added to overall dependency tree possibly?

Tools.jar has been removed in JDK 11 so another option/solution may be needed.

@dmak
Copy link
Owner

dmak commented Oct 18, 2018

This dependency is only used by Unit Tests, i.e. used when you want to build the plugin. I don't have plan to test the build on JDK 11, because I've just adopted JDK 8. JDK 9 is on horizon but newer are far-far away. Hence unless you can contribute the solution, I suggest to close the ticket, as there is no requirement that the module should be build on JDK 11.

What concerns JAXB 2.3.x: It may work, or may not work. If you find a concrete issue, please, read bug reports section and open a new ticket.

@dmak dmak added the not an issue Something to do with a documentation, examples, etc label Oct 18, 2018
@mb-3000
Copy link
Author

mb-3000 commented Oct 19, 2018

I rebuilt it against JDK 11 and it works and the errors will disappear so its the maven dependency chain to 2.2.1 jars in your plugin that generates errors using JDK 11. I still have it building for JDK 8 as a minimum even though that JDK is going to EOL come January. JDK 11 is the the LTS version now so unless you are going to be writing apps on a support contracted JDK 8 from Oracle or others it will be unsupported for security patches which is not something we can do, nor would most enterprise customers.

Most of the failing tests I get are around JAXB changing the output for javadoc generation to have parameters in them as well now so we get a few assert issues but nothing major.

There are two tests that are more around some dependency on dynamically loading the JAXBFactory in a test that I haven't fixed.

I can make a PR but if you don't want to build against JDK 11 I don't think it will be much use to you or others.

@dmak
Copy link
Owner

dmak commented Oct 20, 2018

Creating a PR will not harm, so please go ahead. Someone could benefit from it for sure.

At the moment there are no plans to migrate to JDK 11. Eclipse has just released / announced JDK 11 support in v4.9, and I would assume that certain time will be needed for feature stabilization. JaCoCo just announced JDK 11 experimental support. So there are few places which need more closer look before jumping into the sea.

However migration sooner or later will take place. We need just a critical mass.

Anyway I wonder why would you need to recompile the plugin? If it runs on JDK 11 fine, just use maven dependency exclusion.

@gicappa
Copy link

gicappa commented Jul 19, 2019

I'm on JDK11 as well. I'll try to get it working on my own but if you (@mb-3000) have already spent some time on it maybe it would be helpful if you could share your findings. Thanks!

@gicappa
Copy link

gicappa commented Jul 19, 2019

I could get at the same point of compiling the version compatible with JDK 11 but with errors when launching tests.

I'll try to give a look at it and make a pull request if I can provide a solution in a feasible time.

java.lang.InternalError: Unable to load source code of com.sun.tools.xjc.runtime.JAXBContextFactory as a resource
	at com.sun.tools.xjc.addon.xew.XmlElementWrapperPluginTest.runTest(XmlElementWrapperPluginTest.java:285)
	at com.sun.tools.xjc.addon.xew.XmlElementWrapperPluginTest.testInnerElementWithValueObjects(XmlElementWrapperPluginTest.java:132)

@gicappa
Copy link

gicappa commented Jul 19, 2019

After a quick research I think the issue is caused by the fact that switching from version 2.2.X to 2.3.X the jaxb-xjc library doesn't include anymore the source file in the jar while they are needed by the plugin as reported here.

eclipse-ee4j/jaxb-ri#1287

@dmak
Copy link
Owner

dmak commented Jan 9, 2023

The build is now compatible with Java 11, see GitHub actions. JAXB v3 was integrated in issue #66.

@dmak dmak added this to the 2.0 milestone Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not an issue Something to do with a documentation, examples, etc
Projects
None yet
Development

No branches or pull requests

3 participants