jaxb2-maven-plugin icon indicating copy to clipboard operation
jaxb2-maven-plugin copied to clipboard

-dtd option

Open y2kenny opened this issue 2 years ago • 1 comments

When I try to parse a dtd (using sourceType dtd), I get the following error

org.xml.sax.SAXParseException: Are you trying to compile DTD? Support for DTD is experimental. You may enable it by using the -dtd option.

How do I pass the -dtd option to xjc via this plugin?

y2kenny avatar Jun 18 '22 03:06 y2kenny

I think this is a bug in the xjc implementation. When I use version 4.0.3 of xjc, this error no longer occurs.

You can override the version used by the plugin with a dependencies element:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <executions>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>4.0.3</version>
                    </dependency>
                </dependencies>
            </plugin>

RayDeCampo avatar Aug 29 '23 20:08 RayDeCampo