We are looking at upgrading some legacy code to Java 10. As JAXB is not visible by default (EDIT: and the proper long term solution is not to circumvent the symptom using various JVM flags, but fix it properly) I have added this snippet to my pom.xml:
javax.xml.bind
jaxb-api
2.3.0
com.sun.xml.bind
jaxb-core
2.3.0
com.sun.xml.bind
jaxb-impl
2.3.0
Unfortunately there is still a warning printed at startup to stderr. Apparently this is not the correct fix.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/home/tra/.m2/repository/com/sun/xml/bind/jaxb-impl/2.3.0/jaxb-impl-2.3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
The full output from --illegal-access=debug is:
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/home/tra/.m2/repository/com/sun/xml/bind/jaxb-impl/2.3.0/jaxb-impl-2.3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.getMethod(Injector.java:222)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.access$000(Injector.java:74)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector$1.run(Injector.java:175)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector$1.run(Injector.java:172)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.(Injector.java:171)
at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:81)
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:179)
at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:285)
at com.sun.xml.bind.v2.runtime.property.ArrayProperty.(ArrayProperty.java:68)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.(ArrayERProp