在Eclipse執行mvn test產出JUnit的純文字的測試報告很容易,但要執行具html格式的測試報告,則需在pom.xml加上如下的內容,以下出自http://maven.apache.org/plugins/maven-surefire-report-plugin/examples/show-failures.html

<project>
  [...]
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.4.2</version>
        <configuration>
           <showSuccess>false</showSuccess>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  [...]
</project>
  執行產出的命令為mvn surefire-report:report -DshowSuccess=false,至於如何在Eclipse配置這樣的命令目前還不得其法。
arrow
arrow
    全站熱搜

    Jemmy 發表在 痞客邦 留言(0) 人氣()