[英]Is it possible to get maven-jaxb-schemagen-plugin working with Java 7?
[英]control schema file name created by jaxb schemagen maven plugin (maven-jaxb-schemagen-plugin)
我似乎无法弄清楚如何控制由 maven-jaxb-schemagen-plugin 创建的 XSD 文件的文件名。 文档有点稀疏。
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>
<configuration>
<project>${project}</project>
<destdir>${project.build.directory}/generated-resources/schemas</destdir>
<srcdir>${project.build.sourceDirectory}/my/jaxb/bean/package</srcdir>
<verbose>true</verbose>
</configuration>
它似乎总是创建一个名为 schema1.xsd 的文件
您需要添加描述哪个文件应包含您拥有的每个命名空间的元素的架构元素:
<configuration>
[...]
<schemas>
<schema>
<namespace>http://www.example.invalid/2001/05/27/wibble</namespace>
<file>wibble.xsd</file>
</schema>
</schemas>
<configuration>
假设您已经设置了组件的命名空间
@XmlRootElement(name = "wobble", namespace="http://www.example.invalid/2001/05/27/wibble")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.