我正在构建一个 Spring Boot 微服务应用程序,但是当我在 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.
我从 Spring Boot Initialzr 下载了其他项目他们没有显示任何错误,但最近我遇到了这个问题。怎么解决?
最佳答案
这曾经是一个已弃用的行为,最终在 Gradle-6.0
中出错。这是一个已知错误,如果您可以升级到 2019.3 EAP 或测试版,应该可以解决该错误。根据我的经验,如果您将 gradle 包装器更改为 5.6.4
应该可以解决此问题。
只是为了澄清应该在 Spring Boot 应用程序中进行更改。在应用程序的 gradle/wrapper 文件夹下,您会找到 gradle-wrapper.properties。将分发 URL 更新为 distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
或任何其他可以找到相应 gradle zip 文件的来源。
关于java - Spring boot - 不支持不必要地替换不存在的任务。直接使用create()或register()代替,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59452624/