Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot- Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead

I am building a spring boot microservices application but getting this error when I open in intellij idea.

Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead. You attempted to replace a task named 'ZuulServerApplication.main()', but there is no existing task with that name.

I have other projects downloaded from Spring Boot Initialzr they didn't show any error but recently I am getting this issue. How to solve it?

like image 240
rimi reza duity Avatar asked Dec 23 '19 09:12

rimi reza duity


1 Answers

This used to be a deprecated behavior that was finally made an error in Gradle-6.0. Its a known bug which should be solved if you can upgrade to the 2019.3 EAP or beta. In my experience if you change your gradle wrapper to 5.6.4 should solve this problem.

Just to clarify as to where the change should be made in the spring boot app. In the app under gradle/wrapper folder you would find gradle-wrapper.properties. Update the distribution url as distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip or any other source where you can find the appropriate gradle zip file.

like image 57
Shababb Karim Avatar answered Oct 06 '22 00:10

Shababb Karim