如何传递 Gradle 命令参数以通过 Buildship 执行任务

问题描述

我知道如果在 Gradle 中我使用:build -x test 它会构建并且不会执行测试。

在带有 Buildship 的 STS 中以支持 Gradle,例如用于 Spring 集成

它有以下两个我感兴趣的任务(buildtest):

enter image description here

我可以使用以下内容进行构建:

enter image description here

因为某些测试失败(随机)我想跳过测试,所以我尝试了

enter image description here

它失败了:

enter image description here

所以我尝试了:

enter image description here

并且失败了

enter image description here

还有:

enter image description here

什么也没发生,只显示以下内容并停止:

enter image description here

那么如何使用 Buildship 正确表示 build -x test

解决方法

您必须像这样提供 df = data.melt('order_portfolio_num')['value'].value_counts().div(len(data)).mul(100).head() print (df) dog 75.0 cat 62.5 bear 50.0 chicken 50.0 dolphin 37.5 Name: value,dtype: float64 作为程序参数

Program Arguments configuration to exclude tests from Gradle build

或者您只需运行 assemble 而不是 -x testbuild 是一个生命周期任务,它聚合了项目中的所有归档任务,除了其他任务之外,不执行 assemble 任务,例如 check