JAXB2 maven plugin in eclipse shows error

百般思念 提交于 2019-12-12 05:28:21

问题


I'm using JDK 1.6 (due to dependencies) and to generate classes from xsd, I have added maven-jaxb2 plugin as shown below in pom.xml.

But the eclipse (Kepler) complains as below.

Error parsing the command line [[-Xsimplify, -episode, D:\test\workspace\sample\target\generated-sources\xjc\META-INF\sun-jaxb.episode]] (org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.1:generate:jaxb-test:generate-sources)

pom.xml

<plugins>
    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
        </configuration>
    </plugin>
    <plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <version>0.9.0</version>
        <executions>
            <execution>
                <id>jaxb-test</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
                <configuration>
                    <forceRegenerate>true</forceRegenerate>
                    <schemaDirectory>src/main/resources</schemaDirectory>
                    <schemaIncludes>
                        <include>sample.xsd</include>
                    </schemaIncludes>
                    <xjbSources>
                        <xjbSource>bindings.xjb</xjbSource>
                    </xjbSources>
                </configuration>
            </execution>
        </executions>
        <configuration>
            <extension>true</extension>
            <args>
                <arg>-Xsimplify</arg>
            </args>
            <plugins>
                <plugin>
                    <groupId>org.jvnet.jaxb2_commons</groupId>
                    <artifactId>jaxb2-basics</artifactId>
                    <version>0.6.0</version>
                </plugin>
            </plugins>
        </configuration>
    </plugin>
</plugins>

回答1:


Try to upgrade to maven-jaxb2-plugin 0.13.1, and jaxb2-basics 0.11.0.

The versions you have now are very old already.



来源:https://stackoverflow.com/questions/34676734/jaxb2-maven-plugin-in-eclipse-shows-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!