mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
106 stars 77 forks source link

schemagen creates an invalid xsd on JDK11 #129

Closed andrehertwig closed 5 years ago

andrehertwig commented 5 years ago

Hi I don't know if this is a JDK related thing, but: When i do a mvn clean verify with JDK 8 the resulting XSD has a correct syntax with prefix and defined namespace Maven 3.6.0 / Oracle JDK 1.8.0_192

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"> ... </xs:schema>

but if i switch to JDK 11 the prefix (on elements) is gone but namespace declaration is still prefixed Maven 3.6.0 / Open JDK 11.0.2

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"> ... </schema>

See attached test project: xsdschemagen.zip

lennartj commented 5 years ago

This is fixed by the classworlds patch, and handled by the latest commit to master. See #138 .