根据您从 XSD 生成 Java 类的方式,您应该尝试添加可用的现有 XEW 插件之一(这是撰写本文时最先进的插件:https://github.com/dmak/jaxb-xew-插件)
我建议您阅读文档以便做您想做的事情。
这是基于 jaxb-tools maven-plugin 的示例配置:
<plugin>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>correct version according targeted JAXB api</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<extension>true</extension>
<args>
<arg>-Xxew</arg>
</args>
<plugins>
<plugin>
<groupId>com.github.jaxb-xew-plugin</groupId>
<artifactId>jaxb-xew-plugin</artifactId>
<version>correct version according JAXB api</version>
</plugin>
</plugins>
</configuration>
</execution>
</executions>
</plugin>