(004)maven執行junit單元測試,指定執行哪些測試類


  直接上配置,項目pom.xml文件中添加插件:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.19</version>
  <dependencies>
    <dependency>
      <groupId>org.apache.maven.surefire</groupId>
      <artifactId>surefire-junit47</artifactId>
      <version>2.19</version>
    </dependency>
  </dependencies>
  <configuration>
  <!--配置是否跳過測試用例執行-->
    <skipTests>false</skipTests>
    <includes>
      <include>**/ArticleServiceImplTest.java</include>
    </includes>
    <excludes>
      <exclude>**/ArticleControllerTest.java</exclude>
    </excludes>
  </configuration>
</plugin>

  命令:

mvn test

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM