Gradle插件在Intellij IDEA(计算任务图)中不起作用? [英] Gradle plugin doesn't work in Intellij IDEA (Calculate task graph)?

查看:1380
本文介绍了Gradle插件在Intellij IDEA(计算任务图)中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是Intellij IDEA中的gradle插件不适用于我的项目。如果我在命令行中使用gradle build,它可以很好地工作,但是如果我尝试在Intellij IDEA中使用gradle插件构建项目,则无法工作。它显示任务计算任务图中的一些错误。它是什么?


  6:21:57 PM:执行外部任务'gradle build'... 

失败:生成失败一个例外。

*出错了:
在root项目'upload-server'中找不到任务'gradle'。

*尝试:
运行gradle任务以获取可用任务的列表。使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。

构建失败

总时间:3.899秒
在根项目'upload-server'中找不到任务'gradle'。
6:22:01 PM:外部任务执行完成'gradle build'。


问题是因为我使用了gradle build命令在构建项目的插件中,但在gradle插件中,您不需要在任务之前使用gradle。

因此,我运行build命令并且它现在正在工作。


The problem is that gradle plugin in Intellij IDEA doesn't work with my project. If I use "gradle build" in command line it works perfectly but if I try to build the project with gradle plugin in Intellij IDEA it doesn't work. It shows some error on task "Calculate task graph". What is it? Why it doesn't work?

Here is console output:

6:21:57 PM: Executing external tasks 'gradle build'...

FAILURE: Build failed with an exception.

* What went wrong:
Task 'gradle' not found in root project 'upload-server'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.899 secs
Task 'gradle' not found in root project 'upload-server'.
6:22:01 PM: External tasks execution finished 'gradle build'.

解决方案

The problem was because I used "gradle build" command in the plugin to build the project but in the gradle plugin you don't need to use "gradle" before task.
So, I run "build" command and it is working now.

这篇关于Gradle插件在Intellij IDEA(计算任务图)中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆