【问题标题】:test integration phase including jetty:run-war测试集成阶段,包括 jetty:run-war
【发布时间】:2015-11-09 22:02:20
【问题描述】:

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

mvn 包

mvn jetty:run-war

我不想手动操作。我更喜欢使用一个命令创建战争文件和启动码头插件的方式。

这是我的 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 预集成测试

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

mvn jetty:run-war

【问题讨论】:

  • 上面的excertp来自父pom.xml文件。它是否有某种依赖性?
  • 这似乎是个问题,因为我试图在我的子 pom.xml 文件中实现它并且它有效,但是我不能使用命令 mvn jetty:run-war。这似乎很奇怪,因为 maven jetty 插件依赖于位置(多模块 maven 项目)。有什么帮助吗?

标签: maven testing jetty


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

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

    ---Hellojavaworld-pom.xml (parent)
       ----app-pom.xml (child)
       ----jjav-pom.xml (child)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-04
      • 1970-01-01
      • 2013-09-30
      • 1970-01-01
      • 1970-01-01
      • 2015-05-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多