gpt4 book ai didi

maven-surefire-report-plugin 不生成 surefire-report.html

转载 作者:行者123 更新时间:2023-12-04 17:38:55 26 4
gpt4 key购买 nike

我无法获得 maven-surefire-report-plugin 生成 surefire-report.html 当我运行时:

mvn clean deploy site
mvn clean site
mvn site
mvn clean install site

我唯一能够生成报告的时间是我运行时:
mvn surefire-report:report

这是我的 pom.xml
<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>blah.blah</groupId>
<artifactId>build</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>build</name>
<description>build</description>

<properties>
...
</properties>

<modules>
<module>../report</module>
</modules>

<dependencyManagement>
<dependencies>
...
<!-- Custom local repository dependencies -->
<dependency>
<groupId>asm</groupId>
<artifactId>asm-commons</artifactId>
<version>3.1</version>
</dependency>
...
</dependencies>
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
...
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx1024m -XX:MaxPermSize=256m -XX:-UseGCOverheadLimit -Dsun.lang.ClassLoader.allowArraySyntax=true</argLine>
<includes>
<include>**/*Test.java</include>
<include>**/*_UT.java</include>
</includes>
<excludes>
<exclude>**/*_IT.java</exclude>
<exclude>**/*_DIT.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.7.2</version>
</plugin>
</plugins>
</reporting>
</project>

我的项目中有 2 个测试和 测试-*.xml 文件在 中生成万无一失的报告
此外,站点文件夹是用 css 和图像文件夹和内容生成的,但没有报告。

最佳答案

JIRA中报告了类似的问题,解决方案是在 pom.xml 中使用更高版本的 maven-site-plugin 3.0-x:

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
...
</plugins>
</build>

关于maven-surefire-report-plugin 不生成 surefire-report.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9387052/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com