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 fails on empty namespace prefix #100

Closed Enrice closed 6 years ago

Enrice commented 6 years ago

I want to generate XSDs without a namespace prefix on the target namespace. So I do @XmlNs(namespaceURI="http://some.uri/", prefix="") which previously worked (1.6) but no longer does under 2.x.

Could you please tell why?

lennartj commented 6 years ago

The 2.x line of the Jaxb2-Maven-Plugin requires the namespaceURI to relate to at least one non-empty value out of the two properties:

  1. prefix
  2. toFile

Otherwise, two namespace URIs could relate to the same prefix within the compilation unit, essentially producing invalid XSD mappings.

lennartj commented 6 years ago

I will address this within the documentation.