gpt4 book ai didi

gradle - Gradle中的JUnit监听器配置

转载 作者:行者123 更新时间:2023-12-03 05:41:08 30 4
gpt4 key购买 nike

我是Gradle的新手。有自定义的JUnit侦听器,它可以读取自定义的注释数据并生成报告,并且需要将其配置为Gradle的一部分。无论如何,在Gradle 4.4中是否可以在surefire插件下进行配置。

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<properties>
<property>
<name>listener</name>
<value>my.company.MyRunListener</value>
</property>
</properties>
</configuration>
</plugin>

我知道,可能无法像在gradle中那样使用maven插件。我检查了 TestListener,它不支持读取注释以继续进行操作。

我想了解在Gradle中配置JUnit侦听器的方法。

最佳答案

恐怕,Gradle目前不支持JUnit RunListener s。只有打开的票证要求该功能:https://github.com/gradle/gradle/issues/1330

当某人在该票证上贴上mentioned in the comments时,“主要问题[…]是Gradle中缺少TestDescriptor.getAnnotations()”;否则,您可能已经能够将自己的RunListener重写为Gradle TestListener。因此,除非我在浏览机票时错过了一些东西,否则看来您现在似乎很不走运:-(

关于gradle - Gradle中的JUnit监听器配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52934598/

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