2012-09-13 26 views
2

我正在嘗試使用maven工作前後集成階段,無濟於事。 我的目標是通過運行一些必要的二進制文件來設置和拆除集成測試。我正在使用antrun-pluginexec-plugin進行測試,但沒有一個打印這些消息。我正在運行mvn verify。如果我將插件綁定到clean階段並運行mvn clean,則會顯示回顯消息和lsmaven:無法獲得預集成階段的工作

怎麼了?我使用maven3

<build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-failsafe-plugin</artifactId> 
       <version>2.12.3</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.codehaus.mojo</groupId> 
       <artifactId>exec-maven-plugin</artifactId> 
       <version>1.2.1</version> 
       <executions> 
        <execution> 
         <phase>pre-integration-test</phase> 
         <goals> 
          <goal>exec</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <executable>ls</executable> 
        <arguments> 
         <argument>-la</argument> 
        </arguments> 
       </configuration> 
      </plugin> 

      <plugin> 
       <artifactId>maven-antrun-plugin</artifactId> 
       <version>1.7</version> 
       <executions> 
        <execution> 
         <id>xxx</id> 
         <configuration> 
          <target> 
           <echo>Cleaning deployed website</echo> 
          </target> 
         </configuration> 

         <phase>pre-integration-test</phase> 
         <goals> 
          <goal>run</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 
+0

不應該是'mvn test'? – basiljames

+0

nope,因爲故障安全插件 –

+0

在這裏我沒有看到任何明顯的錯誤。你可以將'mvn -X verify'的輸出發佈到pastebin或者github要點或者什麼?這可能揭示更多。 –

回答

0

我幫助別人得到正確earlier配置的故障安全插件。嘗試明確指定故障安全插件執行中的階段。不知道爲什麼這是必要的,因爲故障安全插件文檔表示目標默認情況下應該糾正階段 - 但似乎是這樣。