开发者

control schema file name created by jaxb schemagen maven plugin (maven-jaxb-schemagen-plugin)

I don't seem to be able to work out how to get control the file name of the XSD file created by maven-jaxb-开发者_如何学JAVAschemagen-plugin. The documentation is a bit sparse.

        <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>

It always seems to create a file called schema1.xsd


You need to add schema elements which describe which file should contain the elements of each namespace you have:

<configuration>
    [...]
    <schemas>
       <schema>
          <namespace>http://www.example.invalid/2001/05/27/wibble</namespace>
          <file>wibble.xsd</file>
       </schema>
    </schemas>
<configuration>

Assuming you have set the namespace of you components

@XmlRootElement(name = "wobble", namespace="http://www.example.invalid/2001/05/27/wibble")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜