mojohaus / jaxb2-maven-plugin

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

How to use catalog from external jar? #151

Open tpd-opitz opened 4 years ago

tpd-opitz commented 4 years ago

I have a XSD with some XML types to be used in differend other XSDs. I put this common.xsd in a Jar of its own along with a catalog.xml as defined here: https://github.com/highsource/maven-jaxb2-plugin/wiki/Using-Catalogs

The I placed an xsd:import element in my other XSD refering the namespace of the common.xsd.

But when trying to generate importing XSD via jaxb2-maven-plugin the common.xsd from the catalog is not processed. I get an error:

[ERROR] file:/absolute/path/to/my/xsd/importing-the-common-definitions.xsd [23,67]
org.xml.sax.SAXParseException: src-resolve: Name 'myns:nameType' could not be resolves as  'type definition'-component.

How do I use catalogs with the jaxb2-maven-plugin? Does jaxb2-maven-plugin support catalogs at all?

Serdarrr commented 3 years ago

Have you been able to find a workaround?