【发布时间】:2014-01-23 03:49:10
【问题描述】:
我想从带有 JAXB 注释的类中生成模式。为此,我正在使用 jaxb2-maven-plugin。该插件默认扫描 src/main/java 文件夹以查找包含的源。我想指定一个额外的文件夹来扫描不是 maven 源路径的 java 类。
有人可以帮忙吗?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>${maven.plugin.jaxb2}</version>
<executions>
<execution>
<id>schemagen</id>
<goals>
<goal>schemagen</goal>
</goals>
<phase>process-classes</phase>
<configuration>
<includes>
<include>SomeFolderWhichIsNotInMavenSourcePath/*.java</include>
</includes>
<outputDirectory>${project.build.directory}/schemas</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
-
${basedir}/whatever/**/*.java ? -
不,这不起作用。该插件默认位于 src/main/java 文件夹中。一种方法是在我不想要的 maven 源路径中添加文件夹。
标签: maven jaxb jaxb2 maven-jaxb2-plugin jaxb2-maven-plugin