【问题标题】:How to Tests for a specific module under a project in Jenkins through maven?如何通过maven测试Jenkins项目下的特定模块?
【发布时间】:2012-11-17 07:07:57
【问题描述】:

我使用 Jenkins 构建具有多个模块的项目。该项目有一个根 pom.xml,用于构建该项目下的所有模块。我将此 pom.xml 指定为根 POM。

现在我想将测试作为 “构建后步骤” 运行。但是,我不想在所有模块下运行所有​​测试。我只想在特定模块下运行测试。

我尝试使用 shell 命令将目录更改为必须运行测试然后触发 maven 的模块。我还尝试使用 -f 开关为该特定模块指定 pom.xml。这两个步骤都不起作用。

请帮我解决这个问题。

谢谢

【问题讨论】:

    标签: maven maven-2 jenkins continuous-integration


    【解决方案1】:

    只需从根路径运行:

    mvn -pl :submodule test
    

    原提示:mvn --help

    【讨论】:

    • 我发现 -f 和 -pl 的行为相同。
    • artifactId前面需要一个:,例如:mvn -pl :artifactId test
    猜你喜欢
    • 1970-01-01
    • 2012-09-18
    • 2017-09-30
    • 2016-10-03
    • 1970-01-01
    • 1970-01-01
    • 2018-04-19
    • 2010-12-16
    相关资源
    最近更新 更多