我使用maven jaxb2插件从xsd生成类。
但是,尽管我没有修改XSD /binding文件,但XJC每次都会生成类,所以我运行mvn clean install。
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>发布于 2015-04-02 16:34:37
请运行mvn clean install -X并检查日志。它应该解释为什么重新生成代码(查找depends和produces行)。
https://stackoverflow.com/questions/29406041
复制相似问题