users@jaxb.java.net

Can't get maven-jaxb2-plugin 0.6.1 to use xjc 2.0.5

From: Magnus Larsson <magnus.larsson.ml_at_gmail.com>
Date: Thu, 18 Sep 2008 15:59:01 +0200

I want the maven-jaxb2-plugin to generate jaxb 2.0 source code but cant
figure out on how to make the plugin call xjc 2.0.5.

I have tried with:

    <build>
        <defaultGoal>install</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.6.1</version>

                <dependencies>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>2.0.5</version>
                        <scope>runtime</scope>
                    </dependency>
                </dependencies>

                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaDirectory>myPath...</schemaDirectory>
                    <schemaIncludes>
                        <include>mySchema...</include>
                    </schemaIncludes>
                    <extension>true</extension>
                </configuration>
            </plugin>

But I get an error like:

[INFO] Removed old generateDirectory
'/Users/magnuslarsson/Documents/projects/mlsoa/esb-labs/esblabs-cmf/target/generated-sources/xjc'.
[ERROR] XJC while parsing schema(s): org.xml.sax.SAXParseException:
schema_reference.4: Failed to read schema document
'file:/Users/magnuslarsson/Documents/projects/mlsoa/esb-labs/esblabs-cmf/target/generated-sources/xjc/META-INF/sun-jaxb.episode',
because 1) could not find the document; 2) the document could not be read;
3) the root element of the document is not <xsd:schema>.

When runing without the dependency to xjc 2.0.5 the code generation works
fine but generates jaxb 2.1 code that I can't handle (generating 2.1
specific XmlSeeAlso-annotations)

What should I do to make the plugin generate jaxb 2.0 code?

Thanks,
Magnus.