maven - jibx-maven-plugin 1.2.5 schema-codegen 目标忽略值
问题描述
我想将生成的类存储在 src/main/java 目录中,但由于 jibx-maven-plugin .java 文件的默认设置会转到目标/生成源。
这是我当前的pom.xml
文件,我在其中修改了 的值,<schemaBindingDirectory>
但目标路径没有更改。
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jibx</groupId>
<artifactId>jibx-maven-plugin</artifactId>
<version>1.2.5</version>
<executions>
<execution>
<id>generate-java-code-from-schema</id>
<goals>
<goal>schema-codegen</goal>
</goals>
<configuration>
<schemaLocation>src/main/config</schemaLocation>
<includeSchemas>
<includeSchema>example1.xsd</includeSchema>
</includeSchemas>
<options>
<package>com.poc.jibx</package>
</options>
</configuration>
</execution>
<execution>
<id>compile-binding</id>
<goals>
<goal>bind</goal>
</goals>
<configuration>
<schemaBindingDirectory>src/main/java</schemaBindingDirectory>
<load>true</load>
<validate>true</validate>
<!--<verbose>true</verbose>-->
<verify>true</verify>
</configuration>
</execution>
<execution>
<id>bind-xml</id>
<goals>
<goal>bind</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jibx.config</groupId>
<artifactId>maven-plugin-reactor</artifactId>
<version>1.3.4-SNAPSHOT</version>
</plugin>
</plugins>
</pluginManagement>
</build>
build.xml 文件中是否需要进行任何更改?pom.xml 文件中是否还有其他错误?有人可以帮我改变路径吗?提前感谢您的帮助。
解决方案
如果要在 src/main/java 中创建生成的 java 文件,请包括:
<schemaBindingDirectory>src/main/java</schemaBindingDirectory>
在 schemaLocation 标记之前的绑定配置中。
JiBX 文档中不包含此标记,因为通常您不希望生成的文件包含在源路径中。
我们强烈建议您使用默认文件位置,以免意外提交任何生成的文件。
推荐阅读
- laravel - Laravel 8 jetsream 'user/profile' 端点在 SPA 模式下不显示名称和电子邮件(turbolinks)
- sql - SQL:如果有重复,在下一列添加注释
- keycloak - 仅从 keylcoak 用户端点返回用户的特定字段
- visual-studio - 如何取回原始 mdx 单元组
- java - 从父类型子类对象Java访问子类实例方法
- discord.js - 有没有办法阻止@提及通知?不和谐.JS
- python - 无法抓取跨度标签python
- sql - 对于给定的场景,是否有任何其他选项可以代替替换功能
- angular - Angular 中 Ag-grid 单元的事件侦听器
- laravel - 如何在 vue 中隐藏组件中的模态?