Maven JAXB插件

时间:2015-04-02 06:04:22

标签: xjc maven-jaxb2-plugin

我正在使用maven jaxb2插件从xsd生成类。

但是,XJC每次生成类,我运行mvn clean install,但我没有修改XSD /绑定文件。

PS:我必须进行全新安装,因为这是其他任务所必需的。

forceRegenerate =false无效

请指导。

的pom.xml

<plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.12.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaLanguage>WSDL</schemaLanguage>
                    <!-- TODO need to confirm if directly updating source files are ok. 
                        or should we move to target directory -->
                    <bindingDirectory>${basedir}/src/main/resources/wsdl</bindingDirectory>
                    <generateDirectory>${basedir}/src/main/java</generateDirectory>
                    <generatePackage>com.abc.def.chg.beans</generatePackage>
                    <specVersion>2.1</specVersion>
                    <forceRegenerate>false</forceRegenerate>
                    <plugins>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-basics</artifactId>
                            <version>0.9.3</version>
                        </plugin>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-basics-annotate</artifactId>
                            <version>1.0.1</version>
                        </plugin>
                    </plugins>
                    <args>
                        <arg>-Xannotate</arg>
                        <arg>-XtoString</arg>
                    </args>
                    <schemas>
                        <schema>
                            <fileset>
                                <!-- Defaults to schemaDirectory. -->
                                <directory>${basedir}/src/main/resources/wsdl</directory>
                                <!-- Defaults to schemaIncludes. -->
                                <includes>
                                    <include>*.xsd</include>
                                </includes>
                                <!-- Defaults to schemaIncludes -->
                            </fileset>
                        </schema>
                    </schemas>
                </configuration>
            </plugin>

1 个答案:

答案 0 :(得分:0)

请运行mvn clean install -X并查看日志。它应该解释为什么重新生成代码(查找dependsproduces行)。