【问题标题】:Run testng.xml from command prompt. I have jar that is created from Maven Project. Surefireplugin is not solving my purpose从命令提示符运行 testng.xml。我有从 Maven 项目创建的 jar。 Surefireplugin 没有解决我的目的
【发布时间】:2019-03-08 17:24:01
【问题描述】:

我有什么

从 maven 项目创建的 Jar TestNG.xml 文件

我想要什么

想从命令提示符运行 testng.xml

我尝试了什么

在 pom 中使用了 surefire 插件,然后执行 mvn test 命令。

那有什么问题呢?

Surefire 插件将需要。 src 文件夹,每次它都会构建项目。

任何可用的解决方案?使用 jar 文件和 testng 。我不想使用 src 或 bin

【问题讨论】:

    标签: maven testng


    【解决方案1】:

    您可以使用multi-module maven 项目。

    例如有两个模块,A 和 B。模块 A 将构建 jar 文件,在模块 B 中,您可以将 A 指定为依赖项,然后从那里运行测试。

    【讨论】:

    • 这是为了避免每次执行都构建项目吗?
    • 是的,在构建模块B时,将使用之前从模块A构建的jar文件。
    猜你喜欢
    • 1970-01-01
    • 2014-12-25
    • 1970-01-01
    • 2016-12-09
    • 1970-01-01
    • 1970-01-01
    • 2014-05-04
    • 1970-01-01
    • 2017-06-01
    相关资源
    最近更新 更多