nicolas
nicolas

Reputation: 445

Generating code with maven-jaxb2-plugin does not work with the same configuration after v0.12.0

The same pom.xml is working with maven-jaxb2-plugin v0.11 but not with v0.12.

        <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <extension>true</extension>
                <schemaDirectory>${basedir}/src/wsdl</schemaDirectory>
                <schemaIncludes>
                    <schemaInclude>*.wsdl</schemaInclude>
                </schemaIncludes>
                <bindingDirectory>${basedir}/src/jaxws/</bindingDirectory>
                <generateDirectory>${basedir}/target/jaxws/java</generateDirectory>
                <strict>false</strict>                  
                <verbose>true</verbose>
                <forceRegenerate>true</forceRegenerate>
                <args>
                    <arg>-Xfluent-api</arg>
                </args>
                <plugins>
                    <plugin>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-fluent-api</artifactId>
                        <version>3.0</version>
                    </plugin>
                </plugins>
            </configuration>
        </plugin>

The reason is because after the fix#23 null is returned rather than "systemId" in the MavenCatalogResolver.java (line:64)

Caused by: java.lang.NullPointerException
    at java.net.URI$Parser.parse(URI.java:3003)
    at java.net.URI.<init>(URI.java:578)
    at org.jvnet.jaxb2.maven2.resolver.tools.MavenCatalogResolver.getResolvedEntity(MavenCatalogResolver.java:64) at com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver.resolveEntity(CatalogResolver.java:192)

What would be the right configuration for my pom.xml in order to make it work?

Upvotes: 4

Views: 2311

Answers (1)

lexicore
lexicore

Reputation: 43651

Disclaimer: I am the author of the maven-jaxb2-plugin.

Please file an issue here ans send me a sample project to reproduce (the best would be a pull request to tests.

I'll be fixing this ASAP.

I wonder how a passed systemId can be null but it's a bug anyway. Will be fixed ASAP, I just need a test project to reproduce.

Update.

The 0.12.2 release fixes the NPE you're reporting. However, I'm not sure that it fixes your build. It may well be that you have a different problem. I wonder how systemId can be null.

Please send me the reproducing project for further tests.

Generally it would be better for file bugs and issues on GitHub rather than posting on SO.

Upvotes: 4

Related Questions