【问题标题】:maven Build Lifecycle with google app engine and google web toolkitmaven 使用谷歌应用引擎和谷歌网络工具包构建生命周期
【发布时间】:2012-02-09 16:56:24
【问题描述】:

Maven 具有以下默认生命周期步骤:

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.

maven gwt 插件支持:gwt:compile

maven gae 插件支持:gae:deploy

但底部的两个不是默认 maven 生命周期的一部分(至少来自我们的 pom)。那么,在我们的构建机器上,我们应该在上面运行什么?

我们目前正在运行“mvn test gwt:compile gae:deploy”。对吗?

【问题讨论】:

    标签: google-app-engine gwt maven build lifecycle


    【解决方案1】:

    许多插件不会挂钩到默认生命周期,因为它们会做一些通常没有用的“奇怪”事情。例如,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

    【讨论】:

    • 请注意,gwt:compile 默认绑定到预打包阶段,而不是编译阶段(以便在测试阶段之后运行)
    猜你喜欢
    • 1970-01-01
    • 2012-06-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多