【问题标题】:Tests not running using the 'surefire' plugin for Maven测试未使用 Maven 的“surefire”插件运行
【发布时间】:2023-03-10 18:16:01
【问题描述】:

我正在使用 TestNG 在 Eclipse 中运行我的测试。我已经在我的 pom.xml 文件中设置了 maven-surefire-plugin。 在运行“mvn clean install”时,我收到此错误并且测试不运行。即使我手动尝试使用 TestNG 在 Eclipse 中运行测试,测试也会被跳过并且不会运行。不知道是什么问题。

]2

【问题讨论】:

  • 套件 xml 文件中有什么内容?什么错误?
  • 我附上了两张图片。命令行图片显示了失败构建的错误。
  • 您的项目中似乎未定义${TestSuite}
  • 您的测试套件未定义。你是如何通过你的测试套件的?我期望以下内容: mvn test -DTestSuite=somefile.xml

标签: java testng maven-3 maven-plugin maven-surefire-plugin


【解决方案1】:

您很可能必须将您的 testng.xml(代表 ${TestSuite} 参数的真实文件)指定为 Template XML 文件,如下所述:

http://testng.org/doc/eclipse.html#eclipse-listeners

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-16
    • 1970-01-01
    • 1970-01-01
    • 2020-12-31
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多