gpt4 book ai didi

maven-jaxb2-plugin forceRegenerate=false 不起作用?

转载 作者:行者123 更新时间:2023-12-01 16:29:55 27 4
gpt4 key购买 nike

我正在尝试将 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.

但是自上次构建以来我没有更改这些文件中的任何内容!

我做错了什么?

提前致谢

克莱门特

最佳答案

作为部分解决方法,您可以添加 <noFileHeader>true</noFileHeader>到您的配置,以便生成的源与未更改的 XSD 相同。解决我的存储库提交问题,如果这对您也很重要......

无法阻止 XJC 重新生成,它看起来只是检查时间戳。

关于maven-jaxb2-plugin forceRegenerate=false 不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22475108/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com