Hello all,

I am pondering the future of the JAXB2 Maven plugin, following three rather 
problematic properties:


   - The JAXB2-Maven-Plugin was implemented to delegate Java compilation 
   and XML or Schema compilation to the tools within the JDK.
   - The JAXB support including tooling is removed from JDK 11 and onwards.
   - The tooling contains subtle but rather serious bugs which has created 
   a decently complex mess of workarounds within the plugin. For example - the 
   XML schema created from one of the integration tests within the plugin 
   generates incorrect results in JDK9+, as shown in the snippet below. The 
   JDK8 *schemagen* tool generates a schema element [including child 
   elements] with correct namespace prefix, implying that the schema element 
   correctly resides within the XMLSchema namespace. The JDK9 and JDK10 
   *schemagen* tools incorrectly generates a schema element *without a 
   namespace prefix*, implying that the schema element is placed within the 
   targetNamespace, which is normally the target of each schemagen compilation 
   for each unique XML namespace within the compilation unit.

*Snippets:*

JDK 1.8 execution:
==================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<*xs:schema* version="1.0" targetNamespace="http://acme.com/customer-api"; 
xmlns:tns="http://acme.com/customer-api"; 
*xmlns:xs="http://www.w3.org/2001/XMLSchema"*>

JDK 9,10 execution:
================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<*schema* version="1.0" *targetNamespace="http://acme.com/customer-api"* 
xmlns:tns="http://acme.com/customer-api"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema";>

So ... We have at least 3 options here:


   1. File a bug report against the development of JDK 9 and 10 (but if I 
   understand correctly, there is no development going on within these JDK 
   releases), and hope that this bug gets fixed.
   2. Find another tool to generate XML Schema from JAXB annotations. This 
   seems like a better way than the JDK tooling bug approach above, although 
   it requires a more-or-less complete rewrite of the plugin's internals. 
   Question: What polyglot Annotation processors or DSL generators do you 
   recommend?
   3. Just freeze development of JMP at JDK 8; simply put the codebase into 
   sunset. This is doable, but not really desirable.

What do you think? Which way should we take?

-- 
You received this message because you are subscribed to the Google Groups 
"mojohaus-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojohaus-dev/3bd959d7-c9d7-4d9d-ae8a-5034e07c25a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to