java Gradle 解析依赖项并构建/运行良好,但 IntelliJ 没有

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47196054/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 09:32:20  来源:igfitidea点击:

Gradle resolve dependecies and build/run fine but IntelliJ do not

javagrailsintellij-ideagradledependencies

提问by Guido Muscioni

I am using IntelliJ for one of my java projects. It has to build with gradle and from the command line, it works fine, both build and run. However, Intellij is not able to build and run the project. It can import the project with all the dependencies, but it gives me this error:

我正在将 IntelliJ 用于我的一个 Java 项目。它必须使用 gradle 和命令行进行构建,它可以正常工作,无论是构建还是运行。但是,Intellij 无法构建和运行该项目。它可以导入具有所有依赖项的项目,但它给了我这个错误:

Unable to save plugin settings: The plugin org.jetbrains.plugins.gradle failed to save settings and has been disabled. Please restart IntelliJ IDEA

I have already tried all the solution on the web:

我已经尝试了网络上的所有解决方案:

  • removing cache
  • restart
  • enable gradle
  • enable grail
  • reinstall intellij
  • 移除缓存
  • 重新开始
  • 启用gradle
  • 启用圣杯
  • 重新安装智能

The problem in the project is that when I am writing the java code the parser resolves all the classes, however, at the moment of build I get 92 error of this type:

项目中的问题是,当我编写 java 代码时,解析器会解析所有类,但是,在构建时,我收到了这种类型的 92 错误:

Error:(5, 32) java: package org.eclipse.jdt.core.dom does not exist

But the external libraries are resolved and installed by gradle. Any other solution?

但是外部库是由 gradle 解析和安装的。还有其他解决方案吗?

采纳答案by Guido Muscioni

As suggested by jetBrains support, the problem was related to some missing permission as the project was contained in OneDrive with placeholder function active. Moving the project outside the OneDrive directory will resolve the problem for now.

正如 jetBrains 支持所建议的那样,该问题与某些权限缺失有关,因为该项目包含在 OneDrive 中且占位符功能处于活动状态。将项目移到 OneDrive 目录之外将暂时解决问题。