2011-01-21 2 views
6
나는이 구성 내 통합 테스트를 실행하기 위해 메이븐 안전 장치 플러그인을 사용하기 위해 노력하고있어

: 부두 사전 통합을 시작할 때까지통합 테스트 (안전 장치, 메이븐)를 시작하지 않을

<plugin> 
    <artifactId>maven-failsafe-plugin</artifactId> 
    <version>2.7.1</version> 
    <executions> 
     <execution> 
     <id>integration-test</id> 
     <goals> 
      <goal>integration-test</goal> 
     </goals> 
     </execution> 
     <execution> 
     <id>verify</id> 
     <goals> 
      <goal>verify</goal> 
     </goals> 
     </execution> 
    </executions> 
</plugin> 

<plugin> 
    <groupId>org.mortbay.jetty</groupId> 
    <artifactId>maven-jetty-plugin</artifactId> 
    <version>6.1.7</version> 
    <configuration> 

      <connectors> 
      <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> 
       <port>8080</port> 
       <maxIdleTime>3600000</maxIdleTime> 
      </connector> 
      </connectors> 

     <contextPath>/</contextPath> 
     <scanIntervalSeconds>3</scanIntervalSeconds> 
     <scanTargetPatterns> 
      <scanTargetPattern> 
       <directory>src/main/webapp/WEB-INF</directory> 
       <excludes> 
        <exclude>**/*.jsp</exclude> 
        <exclude>**/*.html</exclude> 
       </excludes> 
       <includes> 
        <include>**/*.page</include> 
        <include>**/*.properties</include> 
        <include>**/*.xml</include> 
       </includes> 
      </scanTargetPattern> 
     </scanTargetPatterns> 
    </configuration> 
    <executions> 
      <execution> 
       <id>start-jetty</id> 
       <phase>pre-integration-test</phase> 
       <goals> 
        <goal>run-war</goal> 
       </goals> 
       <configuration> 
        <scanIntervalSeconds>0</scanIntervalSeconds> 
        <daemon>true</daemon> 
       </configuration> 
      </execution> 
      <execution> 
       <id>stop-jetty</id> 
       <phase>post-integration-test</phase> 
       <goals> 
        <goal>stop</goal> 
       </goals> 
      </execution> 
    </executions> 
</plugin> 

모든 것이 괜찮습니다 테스트 단계. 그러면 뭔가 기다리는 것처럼 아무것도 일어나지 않습니다. 마지막 줄은 말한다 :

[INFO] Started Jetty Server

가 어떻게 테스트를 잘 작성 이후에 시작 만들 수 있습니까? mvn verify을 사용하여 maven을 실행합니다.

+0

버전 8.1.9에서 동일한 문제가 발생합니다. –

+0

9.4.4.v20170414와 동일 – xedo

답변

2

6.1.7에서 6.1.26으로 변경된 jetty maven 플러그인 버전이 모든 것을 해결했습니다.

여전히 해결책을 찾고있는 사람들을 위해
+0

나는 같은 문제에 직면했다. 또한 버전을 6.1.26으로 업그레이드 했는데도 통합 테스트가 실행되지 않습니다. 마지막 줄은 다음과 같습니다. [정보] 부두 서버를 시작했습니다. 그 후에는 아무 일도 일어나지 않습니다. Maven 클린 인스톨 스텝이 멈췄다. 왜 그런 일이 일어나는 지 아십니까? –

+0

버전 9.4.4.v20170414와 동일한 문제가 있습니다. @ 제이 Zus의 솔루션은 올바른 것입니다 – xedo

2

, 그 같은 문제가 없었다 나는 시작하면서,

실행 *가 실행을 차단하고 있기 때문에 작동
<goals> 
    <goal>start</goal> 
</goals> 

에 의해

<goals> 
    <goal>run-war</goal> 
</goals> 

를 대체하여 그것을 해결 비 차단입니다.

+0

이것은 올바른 해결책입니다 – xedo