如何告诉maven-jaxb2-plugin在maven依赖项中的所有.xsd文件上运行xjc?

如何告诉maven-jaxb2-plugin在maven依赖项中的所有.xsd文件上运行xjc?,jaxb,jaxb2,xjc,maven-jaxb2-plugin,Jaxb,Jaxb2,Xjc,Maven Jaxb2 Plugin,我正在使用,我的.xsd文件处于maven依赖关系中。文档显示您在maven依赖项中指定了一个.xsd,如下所示 <schema> <!-- Specifies a schema from the Maven artifact. --> <dependencyResource> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId

我正在使用,我的.xsd文件处于maven依赖关系中。文档显示您在maven依赖项中指定了一个.xsd,如下所示

<schema>
    <!-- Specifies a schema from the Maven artifact. -->
    <dependencyResource>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin-tests-po</artifactId>
        <!--  Version of the artifact. May be omitted.
        The plugin will then try to find the version using
        the dependencyManagement and dependencies of the project. -->
        <version>${project.version}</version>
        <!-- Path of the resource within the artifact. -->
        <resource>purchaseorder.xsd</resource>
    </dependencyResource>
</schema>

org.jvnet.jaxb2.maven2
maven-jaxb2-plugin-tests-po
${project.version}
purchaseorder.xsd
我想在dependent.jar文件中的所有.xsd文件上运行xjc。.xsd文件位于.jar文件中的不同目录中。我试过这个

<resource>**/*.xsd</resource>
***.xsd
但除了这个例外,这一切都失败了

org.xml.sax.SAXParseException; schema_reference.4: Failed to read schema document 'maven:com.dg:XSD:jar::5.0.3.4!/**/*.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
org.xml.sax.SAXParseException;schema_reference.4:未能读取架构文档'maven:com.dg:XSD:jar::5.0.3.4!/***。xsd',因为1)找不到文档;2) 文件无法读取;3) 文档的根元素不是。
当mvn依赖项中的所有.xsd文件位于不同目录中时,是否有方法指定它们

此外,xjc是否可以在一组.xsd文件上排序依赖关系树,其中一个.xsd文件依赖于另一个,而另一个可能依赖于另一个

谢谢

当mvn依赖项中的所有.xsd文件位于不同目录中时,是否有方法指定它们

不,目前您必须指定单个架构文件。您不需要指定所有这些参数,只需指定“根”参数即可。 请放心

此外,xjc是否可以在一组.xsd文件上排序依赖关系树,其中一个.xsd文件依赖于另一个,而另一个可能依赖于另一个

是的,XJC递归地解析模式依赖关系。您可以编译一个大而深的模式林