通过指定插件的新执行,可以将目标绑定到阶段。我假设你已经有了一些自定义的东西来使这些工作正常进行,所以我只关注应该如何将插件目标绑定到特定阶段。
<plugin>
<artifactId>gwt-maven-plugin</artifactId>
...
<executions>
<execution>
<id>gwt-site</id>
<phase>site</phase><!-- phase to bind to -->
<goals>
<goal>compile</goal><!-- goal to run in that phase -->
</goals>
<configuration>
<!-- Your magic configuration stuff goes here -->
</configuration>
</execution>
<!-- Possible other executions might be defined here -->
</executions>
</plugin>
防止从正在运行默认的Maven站点更有趣,因为它是一个阶段,各种各样的绑定到它的目标。通过明确指定没有目标的执行,可以防止标准网站:网站目标在网站阶段中运行。这可能会略有不同,从maven 2到3,所以我会在这里稍微泛泛。看看您的构建日志,看看什么是执行ID方面目前规定,组/工件ID来纠正可能的疏忽在我的例子:
<plugin>
<artifactId>maven-site-plugin</artifactId>
...
<executions>
<execution>
<phase>site</phase>
<goals></goals><!-- This is empty to indicate that no goals should be run in this phase -->
</execution>
</executions>
</plugin>
是你成功的在得到这个工作? – 2011-08-16 10:07:14