# How pass Gradle command parameters to execute a task through Buildship

**URL:** <https://discuss.gradle.org/t/how-pass-gradle-command-parameters-to-execute-a-task-through-buildship/38803>\
**Category:** Help/Discuss\
**Created:** [January 16, 2021, 4:42pm UTC](https://discuss.gradle.org/t/how-pass-gradle-command-parameters-to-execute-a-task-through-buildship/38803 "2021-01-16T16:42:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_pompeii](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@dr\_pompeii](https://discuss.gradle.org/u/dr_pompeii)\
**Post date:** [January 16, 2021, 4:42pm UTC](https://discuss.gradle.org/t/how-pass-gradle-command-parameters-to-execute-a-task-through-buildship/38803/1 "2021-01-16T16:42:44Z")

</div>

I know that if in Gradle I use: `build -x test` it builds and the test are not executed.

In STS with Buildship for support with Gradle, for example for Spring Integration

It has the following two tasks of my interest ( _build_ and _test_ ):

 ![00](https://global.discourse-cdn.com/gradle/original/2X/d/d1308b4d70f14ba4f538ed9a8ab3a673fcfb6ba1.png)

I can build with the following:

 ![01](https://global.discourse-cdn.com/gradle/original/2X/5/54fae9767eceb8e9105948c1ee1cf707d73cc260.png)

Because some test fails (randomly) I want skip the tests, so I tried

 ![02](https://global.discourse-cdn.com/gradle/original/2X/3/398f2a0021511c6026a1c3a83f25eb8e505a92e1.png)

it fails with:

 ![03](https://global.discourse-cdn.com/gradle/original/2X/f/f27357e1b145d216d8275e08b8fd35d810d67654.png)

So I tried with:

 ![04](https://global.discourse-cdn.com/gradle/original/2X/e/ebb1de14a5ca314418de5cdafaed0c71ab7121aa.png)

And fails with

 ![05](https://global.discourse-cdn.com/gradle/original/2X/4/49cb999681b5902e0e2cf77f65ef573ec0794b19.png)

And with:

 ![06](https://global.discourse-cdn.com/gradle/original/2X/c/c2d1f7f789054a9111e299a700d44911f57e856e.png)

Nothing happens, only shows the following and stopping:

![07](https://global.discourse-cdn.com/gradle/original/2X/4/4625f1a5eef1d165bb4b167c9adf1e3afa33e189.png)

So how represent `build -x test` correctly with Buildship?

---

<div class="post-metadata">

**Author:** ![jjustinic](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jjustinic/32/9005_2.png) [@jjustinic](https://discuss.gradle.org/u/jjustinic)\
**Post date:** [January 18, 2021, 4:10am UTC](https://discuss.gradle.org/t/how-pass-gradle-command-parameters-to-execute-a-task-through-buildship/38803/2 "2021-01-18T04:10:26Z")

</div>

It can work more than one way, but most correctly, you have one `Gradle Task`, which is `build` and two `Program Arguments`, which are `-x` AND `test`. You have `-x test` as a single argument, which is the same as writing `gradle build '-x test'` quoted together, not `gradle build -x test`.

---

<div class="post-metadata">

**Author:** ![dr\_pompeii](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@dr\_pompeii](https://discuss.gradle.org/u/dr_pompeii)\
**Post date:** [January 18, 2021, 12:52pm UTC](https://discuss.gradle.org/t/how-pass-gradle-command-parameters-to-execute-a-task-through-buildship/38803/3 "2021-01-18T12:52:14Z")

</div>

Thanks for the reply. Ok, you are explaining the situation and is clear the problem, but you are not indicating _explicitly_ the solution.

The solution is do the following:

![](https://global.discourse-cdn.com/gradle/original/2X/0/06ffd15dfd3150884d85dc57fe62a5ff6d3fcc96.png)

The post and solution is here:

- [How pass Gradle command parameters to execute a task through Buildship](https://stackoverflow.com/a/65772582/3665178)

Of course. Thanks for your support
