Is it possible to get maven-jaxb-schemagen-plugin working with Java 7?

lexicalscope picture lexicalscope · Dec 13, 2011 · Viewed 8.5k times · Source

When I try to use maven-jaxb-schemagen-plugin with java 7

<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>

I get an error:

[ERROR] Failed to execute goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate (default) on project TopologyProvisionerDom: Execution default of goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate failed: A required class was missing while executing com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate: com/sun/mirror/apt/AnnotationProcessorFactory

It seems like the AnnotationProcessorFactory is being removed/deprecated in Java 7? Is it possible to get jaxb schemagen to work using this plugin? Is there an alternative approach to get schema generation from the JAXB source code when using JDK 7?

Answer

Donal Fellows picture Donal Fellows · Dec 13, 2011

Have you tried using the org.codehaus.mojo:jaxb2-maven-plugin instead?