2016-07-13 10 views
1

Mavenのフェイルセーフプラグインを実行しています!私が実行した場合mvn failsafe:integration-testは正常に動作します問題私は悩み基本的にそれが統合テストを実行していない<code>mvn verify</code></p> <p>を使用してフェイルセーフプラグインを実行しているを抱えている

また、統合テストを実行するにはjettyプラグインなどが必要ですか。フェイルセーフのタスクがタスク

コードにチェックインされたことを確認するためにバインドされていません

.. https://github.com/tonymurphy/builder

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.example</groupId> 
    <artifactId>junit-stuff</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 
    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.12</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-jxr-plugin</artifactId> 
      <version>2.5</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-report-plugin</artifactId> 
      <version>2.19.1</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <resources> 
      <resource> 
       <directory>src/main/resources</directory> 
      </resource> 
     </resources> 
     <testResources> 
      <testResource> 
       <directory>src/test/resources</directory> 
      </testResource> 
     </testResources> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>3.5.1</version> 
        <configuration> 
         <source>1.8</source> 
         <target>1.8</target> 
        </configuration> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-surefire-plugin</artifactId> 
        <version>2.19</version> 
        <executions> 
         <execution> 
          <id>default-test</id> 
          <phase>none</phase> 
         </execution> 
         <execution> 
          <id>unit-test</id> 
          <phase>test</phase> 
          <goals> 
           <goal>test</goal> 
          </goals> 
          <configuration> 
           <includes> 
            <include>**/*.java</include> 
           </includes> 
           <excludes> 
            <exclude>**/*$*</exclude> 
            <exclude>**/*ContractTest.java</exclude> 
            <exclude>**/*MvcTest.java</exclude> 
            <exclude>**/*_Test.java</exclude> 
           </excludes> 
           <excludedGroups>com.example.OneAtATime</excludedGroups> 
          </configuration> 
         </execution> 
         <execution> 
          <id>mvc-tests</id> 
          <phase>test</phase> 
          <goals> 
           <goal>test</goal> 
          </goals> 
          <configuration> 
           <includes> 
            <include>**/*MvcTest.java</include> 
           </includes> 
           <excludedGroups>com.example.OneAtATime</excludedGroups> 
           <excludes> 
            <exclude>**/*$*</exclude> 
            <exclude>**/*ContractTest.java</exclude> 
            <exclude>**/*_Test.java</exclude> 
           </excludes> 
          </configuration> 
         </execution> 
        </executions> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-failsafe-plugin</artifactId> 
        <version>2.19.1</version> 
        <executions> 
         <execution> 
          <id>integration-test</id> 
          <configuration> 
           <groups>com.example.OneAtATime</groups> 
          </configuration> 
          <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.2.2.v20140723</version> 
        <configuration> 
         <scanIntervalSeconds>10</scanIntervalSeconds> 
         <stopPort>8005</stopPort> 
         <stopKey>STOP</stopKey> 
        </configuration> 
        <executions> 
         <execution> 
          <id>start-jetty</id> 
          <phase>pre-integration-test</phase> 
          <goals> 
           <!-- stop any previous instance to free up the port --> 
           <goal>stop</goal> 
           <goal>start</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> 
      </plugins> 
     </pluginManagement> 
    </build> 
    <reporting> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jxr-plugin</artifactId> 
       <version>2.5</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-report-plugin</artifactId> 
       <version>2.19.1</version> 
       <reportSets> 
        <reportSet> 
         <id>integration-tests</id> 
        <reports> 
         <report>failsafe-report-only</report> 
        </reports> 
        </reportSet> 
       </reportSets> 
      </plugin> 
     </plugins> 
    </reporting> 
</project> 
+0

これに対する解決策はありますか? – RahulB

+0

申し訳ありません。解決策が見つかりません –

答えて

0

あなたが確認する目的のために個別の実行を作成する必要があります。

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-failsafe-plugin</artifactId> 
    ... 
    <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> 
関連する問題

 関連する問題