# Task 'install' not found in root project

**URL:** <https://discuss.gradle.org/t/task-install-not-found-in-root-project/39849>\
**Category:** Help/Discuss\
**Created:** [May 4, 2021, 5:48pm UTC](https://discuss.gradle.org/t/task-install-not-found-in-root-project/39849 "2021-05-04T17:48:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitdaundkar](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@amitdaundkar](https://discuss.gradle.org/u/amitdaundkar)\
**Post date:** [May 4, 2021, 5:48pm UTC](https://discuss.gradle.org/t/task-install-not-found-in-root-project/39849/1 "2021-05-04T17:48:19Z")

</div>

hello,  
i can run gradle build command successfully but when i run ‘gradle build install’ or ‘gradle install’ i get error - Task ‘install’ not found in root project. Gradle version i am using is 7.0

Please advise on how can i resolve the error.  
Thanks

---

<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:** [May 4, 2021, 9:45pm UTC](https://discuss.gradle.org/t/task-install-not-found-in-root-project/39849/2 "2021-05-04T21:45:43Z")

</div>

Obviously the build you are trying to run does not have a task with that name.  
If you search for something like the `install` goal in Maven, chances are you have `publishToMavenLocal` task available.

---

<div class="post-metadata">

**Author:** ![amitdaundkar](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@amitdaundkar](https://discuss.gradle.org/u/amitdaundkar)\
**Post date:** [May 5, 2021, 5:21am UTC](https://discuss.gradle.org/t/task-install-not-found-in-root-project/39849/3 "2021-05-05T05:21:40Z")

</div>

> [@Vampire](#):
>
> publishToMavenLocal

Thank you Bjorn. Will I be able to use install task if i use another gradle version. In that case, will you kindly suggest me which gradle version shall i use.  
Thank you again.

---

<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:** [May 5, 2021, 9:04am UTC](https://discuss.gradle.org/t/task-install-not-found-in-root-project/39849/4 "2021-05-05T09:04:46Z")

</div>

> [@amitdaundkar](#):
>
> Thank you Bjorn.

My name is not Bjorn, but Björn or Bjoern. 😉

> [@amitdaundkar](#):
>
> Will I be able to use install task if i use another gradle version. In that case, will you kindly suggest me which gradle version shall i use.

That’s not a question of Gradle version, but of the build you are running.  
Each build can define a task called `install` by just writing one line in the build script.  
The task will then just not do anything.  
You can also apply some plugin that adds an `install` task to a build with some semantic, but that is totally up to the author of a build script.  
No Gradle version will by default add any task to any build besides the most basic utility tasks like `tasks`, or `projects`.

If this is a foreign build you want to run, look at its documentation how to run it or ask the author.  
If you are trying to create a build, you should maybe look at the user guide and sample projects.

---

<div class="post-metadata">

**Author:** ![s-pedamallu](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@s-pedamallu](https://discuss.gradle.org/u/s-pedamallu)\
**Post date:** [June 28, 2021, 6:29pm UTC](https://discuss.gradle.org/t/task-install-not-found-in-root-project/39849/5 "2021-06-28T18:29:23Z")

</div>

@Vampire I did look at your response [https://stackoverflow.com/a/47606508/3236309](https://stackoverflow.com/a/47606508/3236309) on a similar question as well. I’m an absolute newbie to gradle and know nothing about it. I’m having this similar issue where I want to convert my gradle project to maven and when I add `apply plugin: 'maven'` to `build.gradle` file and run `gradle install` command, it fails with `Task 'install' not found in root project`.

I’m sorry, but I do not understand your answer. Could you please tell me a little bit in detail on how to unblock myself from this issue. What do you mean by The `install` task is added by the `maven` plugin _if_ you apply it to your build which you didn’t do? Do I have to run `gradle init` on an already gradle project?

---

<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 29, 2021, 9:09pm UTC](https://discuss.gradle.org/t/task-install-not-found-in-root-project/39849/6 "2021-06-29T21:09:54Z")

</div>

If you are new to Gradle, you should start with the official documentation, not with age-old StackOverflow answers, that are long outdated.

If you want to publish to a Maven repository which I interpret from your question, even in that SO answer I recommended using `maven-publish` instead of `maven`.  
In current versions of Gradle this is not even a recommendation anymore as the legacy deprecated `maven` plugin was removed in the meantime for recent Gradle versions (7+).

Any answer or tutorial you find for Gradle that has reached a certain age has good chances to be outdated, as Gradle is evolving. If you see something using `compile '...'` =\> outdated. If you see something using `apply plugin: ...` most probably outdated. …

If you want to publish to a Maven repository, use the `maven-publish` plugin and generally apply plugins in a `plugins { ... }` block, not using the legacy `apply plugin: ...` which will be deprecated at some point.

You have for example:  
[https://docs.gradle.org/current/samples/sample\_publishing\_java\_libraries.html#header](https://docs.gradle.org/current/samples/sample_publishing_java_libraries.html#header)  
or  
[https://docs.gradle.org/current/userguide/publishing\_setup.html](https://docs.gradle.org/current/userguide/publishing_setup.html)  
for further information.  
The official docs are imho quite nice and always better and more up to date than any answer to a similar question you just blindly copy and paste. 😉
