Maven 运行集成测试时,构建在Jetty启动时等待

Maven 运行集成测试时,构建在Jetty启动时等待,maven,maven-jetty-plugin,Maven,Maven Jetty Plugin,我正在尝试运行一些集成/验收测试 我只想在传递环境变量时运行这些测试,因此我使用以下命令: mvn clean install -Denv="acceptance" 但是构建在 2015-09-28 18:56:19.273:INFO:oejsh.ContextHandler:main: Started o.e.j.m.p.JettyWebAppContext@4bbc9862{/,file:///home/stephane/dev/java/projects/kahoot-rest/src/

我正在尝试运行一些集成/验收测试

我只想在传递环境变量时运行这些测试,因此我使用以下命令:

mvn clean install -Denv="acceptance"
但是构建在

2015-09-28 18:56:19.273:INFO:oejsh.ContextHandler:main: Started o.e.j.m.p.JettyWebAppContext@4bbc9862{/,file:///home/stephane/dev/java/projects/kahoot-rest/src/main/webapp/,AVAILABLE}{file:///home/stephane/dev/java/projects/kahoot-rest/src/main/webapp/}
2015-09-28 18:56:19.419:INFO:oejs.ServerConnector:main: Started ServerConnector@26b4acf4{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2015-09-28 18:56:19.423:INFO:oejs.Server:main: Started @171829ms
[INFO] Started Jetty Server
我正在使用Java1.8

我的pom.xml文件:

    <profile>
        <id>acceptance</id>
        <activation>
            <property>
                <name>env</name>
                <value>acceptance</value>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>failsafe-maven-plugin</artifactId>
                    <version>2.4.3-alpha-1</version>
                    <configuration>
                        <includes>
                            <include>**/acceptance/*.java</include>
                        </includes>
                        <excludes>
                            <exclude>**/*$*</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <version>9.3.4.RC0</version>
                    <executions>
                        <execution>
                            <id>start-jetty</id>
                            <phase>pre-integration-test</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>stop-jetty</id>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>stop</goal>
                            </goals>
                            <configuration>
                                <stopKey>stop</stopKey>
                                <stopPort>8081</stopPort>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <scanIntervalSeconds>10</scanIntervalSeconds>
                        <connectors>
                            <connector implementation="org.eclipse.jetty.nio.SelectChannelConnector">
                                <port>8080</port>
                                <maxIdleTime>60000</maxIdleTime>
                            </connector>
                        </connectors>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

接受
环境
接受
org.codehaus.mojo
故障保护maven插件
2.4.3-α-1
**/验收/*.java
**/*$*
集成测试
验证
org.eclipse.jetty
jetty maven插件
9.3.4.0
起动码头
预集成测试
跑
停靠码头
整合后测试
停止
停止
8081
10
8080
60000
更改

<goal>run</goal>
运行

开始
和添加守护程序选项


真的

您可能知道为什么在使用我的应用程序live时AngularJS会使用url访问REST端点,但在Jetty下的验收测试中使用REST端点时,会在url下找到它们?我知道了。我只需要在Jetty服务器的配置中添加一个上下文:/kahoot rest
<goal>start</goal>
<configuration>
    <daemon>true</daemon>
</configuration>