maven-jaxb2-plugin 不生成源代码
maven-jaxb2-plugin not generating sources
如果有人能帮助我,那就太好了。我是 Maven 的新手。当执行 generate-sources 或 compile 时,Maven 对此很安静,不会生成任何东西。
<build>
<pluginManagement>
<plugins>
...
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.11.0</version>
<executions>
<execution>
<id>jaxb-test</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<forceRegenerate>true</forceRegenerate>
<schemaDirectory>src/main/resources</schemaDirectory>
<schemaIncludes>
<include>sample.xsd</include>
</schemaIncludes>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
使用 build/plugins
,而不是 build/plugins/pluginManagement
。
请参考确切的副本:
maven goal doesn't execute properly if plugins are defined under pluginManagement
如果有人能帮助我,那就太好了。我是 Maven 的新手。当执行 generate-sources 或 compile 时,Maven 对此很安静,不会生成任何东西。
<build>
<pluginManagement>
<plugins>
...
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.11.0</version>
<executions>
<execution>
<id>jaxb-test</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<forceRegenerate>true</forceRegenerate>
<schemaDirectory>src/main/resources</schemaDirectory>
<schemaIncludes>
<include>sample.xsd</include>
</schemaIncludes>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
使用 build/plugins
,而不是 build/plugins/pluginManagement
。
请参考确切的副本:
maven goal doesn't execute properly if plugins are defined under pluginManagement