我似乎不知道如何控制maven-jaxb-schemagen plugin创建的XSD文件的文件名。documentation有点稀疏。
<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的文件
发布于 2011-05-27 18:29:17
您需要添加架构元素,用于描述哪个文件应包含您拥有的每个命名空间的元素:
<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")https://stackoverflow.com/questions/6150884
复制相似问题