maven-jaxb2-plugin没有生成源

时间:2015-07-24 21:24:44

标签: maven maven-jaxb2-plugin

如果有人可以帮助我,那就太好了。我是Maven的新手。执行generate-sources或编译时,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>

1 个答案:

答案 0 :(得分:3)

使用build/plugins,而不是build/plugins/pluginManagement

请参阅完整的副本:

maven goal doesn't execute properly if plugins are defined under pluginManagement