phax / maven-jaxb2-plugin

The most advanced JAXB 2.x/3.0/4.0 Maven Plugin for XML Schema compilation.
BSD 2-Clause "Simplified" License
7 stars 2 forks source link

catalog.xml ignored after upgrade from 0.16.0 to 0.16.1 #11

Closed dmngb closed 8 months ago

dmngb commented 1 year ago

Our build stopped working after upgrade from 0.16.0 to 0.16.1. We are using episodes and an XML catalog.

<groupId>com.helger.maven</groupId>
<artifactId>jaxb30-maven-plugin</artifactId>
<configuration>
        <extension>true</extension>
        <useDependenciesAsEpisodes>true</useDependenciesAsEpisodes>
        <schemaDirectory>${xsdDirectory}</schemaDirectory>
        <catalog>${xsdDirectory}/catalog.xml</catalog>
        <strict>false</strict>
        <schemaIncludes>
                <schemaInclude>**/*.xsd</schemaInclude>
        </schemaIncludes>
</configuration>

and the XML catalog contains something like:

<catalog  xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
        <rewriteSystem
                systemIdStartString="http://schema.example.com/"
                rewritePrefix="com/example/schema/"
        />
</catalog>

After upgrade to 0.16.1, JAXB generation does not work anymore (Caused by: java.net.UnknownHostException: schema.example.com). This is typically the kind of error we get if we comment out the catalog parameter in the plugin configuration.

Not sure it's related, but there's this line in maven debug output (-X): java.lang.ClassNotFoundException: org.apache.xml.resolver.readers.OASISXMLCatalogReader

dmngb commented 1 year ago

example.tar.gz Example maven project (Java 11) for reproducing the issue attached.

mvn clean install # OK
mvn clean install -Djaxb=0.16.1 # FAILURE
laurentschoelens commented 11 months ago

@dmngb since you're using v3 plugin, could you give it a try with highsource original plugin ?

https://github.com/highsource/jaxb-tools

V3.0.1 has been released a few days ago and V4 is on its way

dmngb commented 8 months ago

The example above builds successfully when using the highsource original plugin (both 3.0.1 and 4.0.0).

laurentschoelens commented 8 months ago

That's good news 😄

phax commented 8 months ago

Excellent - as I plan to move to the highsource plugin as well, I am closing this issue then. Thanks for the confirmation