【问题标题】:How to exclude test task when the gradle build task is run using Eclipse Buildship plugin?使用 Eclipse Buildship 插件运行 gradle 构建任务时如何排除测试任务?
【发布时间】:2020-11-11 12:53:34
【问题描述】:

我正在使用 Eclipse Buildship 插件在我的项目中执行 Gradle 任务。知道如何在运行构建任务时排除测试任务吗?在 Gradle STS 插件中,我曾经将程序参数更新为 '-x test',从而跳过了测试任务。当我尝试使用 Buildship 进行相同操作时,出现以下错误。

* What went wrong:
Task ' test' not found in root project

【问题讨论】:

    标签: eclipse gradle buildship


    【解决方案1】:

    您是否考虑过运行“组装”任务而不是“构建”?

    :build
    +--- :assemble
    |    \--- :jar
    |         \--- :classes
    |              +--- :compileJava
    |              \--- :processResources
    \--- :check
         \--- :test
              +--- :classes
              |    +--- :compileJava
              |    \--- :processResources
              \--- :testClasses
                   +--- :compileTestJava
                   |    \--- :classes
                   |         +--- :compileJava
                   |         \--- :processResources
                   \--- :processTestResources
    

    【讨论】:

    • 感谢您的建议。是的,组装任务帮助我跳过测试任务。无论如何,如果有一种方法可以在 Buildship 中运行构建任务时跳过测试任务,请分享。只是好奇!。
    【解决方案2】:

    在运行配置中的程序参数中添加“-x test”

    【讨论】:

      【解决方案3】:

      对我来说。为了让 BuildShip 工作,我必须将“-x”和“test”放在不同的行上。

      【讨论】:

        猜你喜欢
        • 2016-11-22
        • 1970-01-01
        • 1970-01-01
        • 2017-12-31
        • 2014-07-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-03-15
        相关资源
        最近更新 更多