# How to run single task from multiple tasks?

**URL:** <https://discuss.gradle.org/t/how-to-run-single-task-from-multiple-tasks/43184>\
**Category:** Help/Discuss\
**Created:** [June 23, 2022, 7:39am UTC](https://discuss.gradle.org/t/how-to-run-single-task-from-multiple-tasks/43184 "2022-06-23T07:39:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LionHeart995](https://avatars.discourse-cdn.com/v4/letter/l/9de053/32.png) [@LionHeart995](https://discuss.gradle.org/u/LionHeart995)\
**Post date:** [June 23, 2022, 7:39am UTC](https://discuss.gradle.org/t/how-to-run-single-task-from-multiple-tasks/43184/1 "2022-06-23T07:39:23Z")

</div>

Hello Guys,

I have 10 tasks in my project but I want to run only one task from them when I fire a command like `gradle <task_name>` then it should run only that task but it runs all the tasks present in my grade script. I want to create a Jenkins job for the same. and in Jenkins job same problem occers.

can anyone help me out

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [June 23, 2022, 2:46pm UTC](https://discuss.gradle.org/t/how-to-run-single-task-from-multiple-tasks/43184/2 "2022-06-23T14:46:28Z")

</div>

Hard to guess without you showing your actual build script.  
But my suspicion is, that you do not do your work in the execution phase but in the configuration phase and additionally do not leverage the task configuration avoidance. The former being a major error, the latter “just” a bad practice.

I suspect so, because you already answered your actual question. While you should practically never use `gradle`, but always the Gradle wrapper `gradlew`, giving the task name is perfectly fine and if that task does not depend on the others, they will not be executed. You can also look at a build scan using `--scan` parameter to gather more insight on what happened in your build run.
