我正在尝试将 maven-jaxb2-plugin 配置为仅在 XSD 更改时生成 java。这似乎不起作用,因为总是重新生成 java 类。这是插件配置:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.3</version>
<configuration>
<generateDirectory>${basedir}/src/main/java/</generateDirectory>
<strict>true</strict>
<verbose>true</verbose>
<readOnly>true</readOnly>
<episode>true</episode>
<forceRegenerate>false</forceRegenerate>
<removeOldOutput>false</removeOldOutput>
</configuration>
<executions>
<execution>
<id>commun-generate</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatePackage>my.package.dest</generatePackage>
<schemaDirectory>${basedir}/src/main/resources/schemas/wsrest</schemaDirectory>
<bindingDirectory>${basedir}/src/main/resources/schemas/wsrest</bindingDirectory>
<bindingIncludes>
<include>bindings.xml</include>
</bindingIncludes>
<episodeFile>${basedir}/src/main/java/META-INF/sun-jaxb_commun.episode</episodeFile>
</configuration>
</execution>
构建时(maven clean install 或 maven install)我可以观察到这个输出:
[INFO] File [D:\IDE\Data\Eclipse\workspace\MyProject\src\main\resources\schemas\wsrest\myXSD.xsd] was changed since the last build.
[INFO] File [D:\IDE\Data\Eclipse\workspace\MyProject\src\main\resources\schemas\wsrest\bindings.xml] was changed since the last build.
[INFO] File [D:\IDE\Data\Eclipse\workspace\MyProject\pom.xml] was changed since the last build.
但是自上次构建以来,我没有更改这些文件中的任何内容!
我究竟做错了什么?
提前致谢
克莱门特