通過指定插件的新執行,可以將目標綁定到階段。我假設你已經有了一些自定義的東西來使這些工作正常進行,所以我只關注應該如何將插件目標綁定到特定階段。
<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