Gradle Clean安装 - 任务'安装'在根项目中找不到
我正在尝试使用 gradle 构建应用程序 :
执行上述命令时出现错误,如下所示 在根项目中找不到任务“安装”
根据文档,插件 - maven 在 gradle 7.4 下被删除。所以我使用 插件 - maven-publish 推荐用于 7.4
目前我使用以下版本
Java - 11
Gradle - 7.4
如果该问题有任何解决方案,请告诉我
I am trying to build the application using gradlegradlew clean install
while executing the above command got error as,
Task 'install' not found in root project
As per the documentation, plugin - maven is removed under gradle 7.4 . So I am using plugin - maven-publish which is recommended for 7.4
Currently I am using below versions
Java - 11
Gradle - 7.4
Please let me know if there is any solution for the issue
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很难猜测,实际的gradle看不到。
当我通过5.5到7.4.2时,我也有类似的问题。错误是相同的:在root项目中找不到任务“安装”。
我只是将所有“编译”更改为依赖项声明中的“实现”,以执行以下书面的完整迁移。
然后,通过“构建”项目,所有依赖项已下载和索引。
参考:
https://docs.gradle.org/7.0/userguide/upgrading_version_5.html#deppedencies_should_no_no_no_no_no_be_declared_the_compile_compile_compile_compile_runtime_runtime_configuration弃用的Gradle Maven插件(Maven)。您应该使用现代的Gradle Maven Publish插件(Maven-Publish)及其任务Publishtomavenlocal。
参考:
noreferrer'> referecation install
!还要注意其他弃用的任务和新的Sintaxes。您会在同一文档中找到详细信息
its difficult to guess cause it's not visible the actual gradle.
I had a similar issue when I passed from 5.5 to 7.4.2. The error was the same: Task 'install' not found in root project.
I had just to change all the 'compile' into 'implementation' in the dependencies declaration to execute a complete migration as it is written below.
Then by "build" the project all the dependency has been downloaded and indexed.
ref: change compile
However, the Gradle task install is part of the deprecated Gradle Maven plugin (maven). You should use the modern Gradle Maven Publish plugin (maven-publish) and its task publishToMavenLocal.
ref:
deprecation install
!! also pay attention to the other deprecated task and the new sintaxes. You will find details in the same docs