我使用下面的代码从带注释的 java 类生成 XSD。XSD 的默认名称始终为“schema1.xsd”。我应该如何仅使用该插件预先定义它?目前我使用 maven-antrun-plugin 进行文件重命名。插件手册不包含相关信息。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<goals>
<goal>schemagen</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<sources>
<source>src/main/java/***some package***</source>
</sources>
<outputDirectory>${project.build.directory}/generated-sources/schemas</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>