2012-01-13 55 views
0

Maven有以下默认的生命周期步骤:Maven构建生命周期与谷歌应用程序引擎和谷歌Web工具包

validate - validate the project is correct and all necessary information is available 
compile - compile the source code of the project 
test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed 
package - take the compiled code and package it in its distributable format, such as a JAR. 
integration-test - process and deploy the package if necessary into an environment where integration tests can be run 
verify - run any checks to verify the package is valid and meets quality criteria 
install - install the package into the local repository, for use as a dependency in other projects locally 
deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects. 

行家GWT插件支持:GWT:编译

行家GAE插件支持:GAE:部署

但底部的两个都不是默认的Maven生命周期(至少从我们POM)的一部分。所以,我们的构建机器上,我们应该在其上运行?

我们目前正在运行的 “MVN测试GWT:编译GAE:部署”。这样对吗?因为他们做“古怪”事情是不是非常有用

回答

3

许多插件不勾到默认的生命周期。例如,GWT编译器需要很长时间。

如果你想这样的插件添加到一个阶段,使用execution块(details):

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>gwt-maven-plugin</artifactId> 
    <version>2.4.0</version> 
    <executions> 
     <execution> 
     <phase>compile</phase> 
     <goals> 
      <goal>compile</goal> 
     </goals> 
     </execution> 
    </executions> 
    </plugin> 

compile阶段这将调用插件的目标compile

注意,对于GWT插件,该phase是可选的;如果你调用compile,插件会做正确的事情。

deploy由于剩下的阶段有点多毛:包装太早了,它应该在test之后和install之前。因此,对于deploy,您可以尝试不同的阶段。如果没有任何结果,你仍然需要调用mvn test gae:deploy

+1

请注意,gwt:compile默认绑定到预包装阶段,而不是编译阶段(以便它在测试阶段之后运行) – 2012-01-13 14:30:29