views:

183

answers:

1

I'm trying to generate beans from an xsd by using the jaxb2-maven-plugin maven plugin, however each time the beans are generated i get the following warning. Note that the result beans work. Does anyone know why this happens?

--snip--
[INFO]    task-segment: [deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [jaxb2:xjc {execution: default}]
[INFO] Generating source...
[INFO] parsing a schema...
[INFO] compiling a schema...
[WARNING] null[-1,-1]
org.xml.sax.SAXParseException: generating code
        at com.sun.tools.xjc.ErrorReceiver.debug(ErrorReceiver.java:113)
        at com.sun.tools.xjc.Driver.run(Driver.java:315)
        at org.codehaus.mojo.jaxb2.XjcMojo.execute(XjcMojo.java:301)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
--snip--

This is the config in the pom.xml

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>1.2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <packageName>com.some.package.jaxb</packageName>
                <verbose>true</verbose>
            </configuration>
        </plugin>

While i think i'm technically using 2.0.3 (not 2.0), here is the line of code that starts this issue: http://grepcode.com/file/repo1.maven.org/maven2/com.sun.xml.bind/jaxb-xjc/2.0/com/sun/tools/xjc/Driver.java#315

*If i set verbose to false in the pom i don't get the warning. Is this just a sloppy logging mechanism? *

Thanks

--Matthias

A: 

@lexicore, you are right. It seems like your "de-facto" standard is actually a better choice, and works just as good. For the record this is a good read about the differences.

This is the config i used. I had trouble tracking down what repo it was on. Hopefully this helps someone:

        <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.7.4</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <verbose>true</verbose>
                <schemaDirectory>src/main/xsd</schemaDirectory>
                <generatePackage>com.ninja.jaxb</generatePackage>
            </configuration>
        </plugin>
 ...
<repositories>
    <repository>
        <id>maven-repo2</id>
        <name>Maven Repository</name>
        <url>http://repo2.maven.org/maven2&lt;/url&gt;
    </repository>
</repositories>
mlathe