测试集成阶段包括jetty:run-war

时间:2015-11-09 11:41:10

标签: maven testing jetty

我仍处于创建POM.xml文件的阶段。基本是在构建生命周期中启动jetty插件。到目前为止,我必须输入

  

mvn package

     

mvn jetty:run-war

我不想手动完成。我更喜欢使用one命令创建war文件和jetty插件的方式。

这是我的POM.xml

<plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.2.11.v20150529</version>
                <configuration>
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <webApp>
                        <contextPath>/hellojavaworld</contextPath>           
                    </webApp>    
                    <war>c:\apache-tomcat-7.0.64\webapps\hellojavaworld.war</war>
                </configuration>
                <executions>
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <!--configuration>
                            <daemon>true</daemon>
                        </configuration-->
                    </execution>
                    <execution>
                        <id>stop-jetty</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
</plugin>

为什么在插入以下命令时没有启动jetty插件?

  

mvn pre-integration-test

有什么问题? jetty插件仅在使用命令

时启动
  

mvn jetty:run-war

2 个答案:

答案 0 :(得分:0)

  

来自父母:mvn jetty:run-war -pl模块

答案 1 :(得分:0)

解决。 这里提到的多模块项目的jetty插件的属性:Multi-module Maven project and jetty:run

我必须在子pom.xml文件中指定插件和生命周期配置。在父母那里它不起作用。

---Hellojavaworld-pom.xml (parent)
   ----app-pom.xml (child)
   ----jjav-pom.xml (child)
相关问题