2011-01-21 56 views
1

我試圖使用Maven Failsafe插件來運行我的功能/集成測試,根據本指南:http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing,章節使用Maven Failsafe插件運行集成測試Jetty未啓動預集成測試階段(Maven)

但是,jetty並未在預集成測試階段啓動,因此所有測試均失敗。是否有下面的POM配置中的任何問題:

<plugin> 
    <artifactId>maven-failsafe-plugin</artifactId> 
    <version>2.7.1</version> 
    <executions> 
     <execution> 
     <goals> 
      <goal>integration-test</goal> 
      <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> 
     <execution> 
      <execution> 
       <id>start-jetty</id> 
       <phase>pre-integration-test</phase> 
       <goals> 
        <goal>run-exploded</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> 
     </execution> 

    </configuration> 
</plugin> 

我通過mvn verify

+0

請添加`mvn -X verify`的輸出。 – 2011-01-21 13:38:05

回答

0

運行集成測試我知道爲什麼 - 首先,我把execution標籤另一execution標籤(而不是executions)內,然後這executions塊不應該在configuration標籤內,但在其外部,正好在plugin標籤內。

相關問題