我正在尝试获取最具伸缩性的html报告,我发现了很多这样的配置:
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>1.0-M2</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<testFailureIgnore>true</testFailureIgnore>
<filereports>NCXEHLOWFD file/constrained.txt,file/full.txt</filereports>
<xmlreports>xml</xmlreports>
<htmlreports>html/report.html</htmlreports>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin> 但是IntelliJ告诉我不允许使用xmlreports和htmlreports,也不会生成xml或html报告。
有没有人能提点建议?我会非常感激的
发布于 2013-03-08 03:08:29
您需要使用当前可用的最新插件版本1.0-M4-SNAP1,而不是没有htmlreports属性的1.0-M2。以下是我的pom.xml中的重要部分:
<project>
<properties>
<scala.version>2.9.3</scala.version>
<scalatest.version>2.0.M5b</scalatest.version>
<scalatest.plugin.version>1.0-M4-SNAP1</scalatest.plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>${scalatest.plugin.version}</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>WDF TestSuite.txt</filereports>
<htmlreporters>${project.build.directory}/html/scalatest</htmlreporters>
<testFailureIgnore>false</testFailureIgnore>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.version}</artifactId>
<version>${scalatest.version}</version>
<scope>test</scope>
</dependency>
<!-- required by scalatest-maven-plugin to generate HTML report -->
<dependency>
<groupId>org.pegdown</groupId>
<artifactId>pegdown</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>有了这个设置,我可以运行mvn clean install,它将在${project.build.directory}/html/scalatest下生成漂亮的超文本标记语言报告
发布于 2019-05-09 19:17:38

@rozky的解决方案适用于我,但是css很笨拙。它不能正确显示表格。无论我使用什么版本的pegdown和scalatest-maven-plugin,它都不会显示表中的套件名称列:/
https://stackoverflow.com/questions/13565328
复制相似问题