【发布时间】: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 项目)。有什么帮助吗?