Gradle resolve dependecies and build/run fine but IntelliJ does not
Answered
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:
Unable to save plugin settings: The plugin org.jetbrains.plugins.gradle failed to save settings and has been disabled. Please restart IntelliJ IDEA
It can import the project with all the dependencies, but it gives me this error:
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
- restart
- enable gradle
- enable grail
- reinstall intellij
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:
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?
Any other solution?
Note: on another computer IntelliJ works fine
Please sign in to leave a comment.
Replied here: https://stackoverflow.com/questions/47196054/gradle-resolve-dependecies-and-build-run-fine-but-intellij-do-not#comment81341496_47196054.
You can also try to delete .idea directory and reimport the project from Gradle.
See if https://www.jetbrains.com/idea/nextversion/ works.
Otherwise report at https://youtrack.jetbrains.com/issues/IDEA with idea.log attached (https://intellij-support.jetbrains.com/hc/articles/207241085).
The solution does not work.
I figure out that IntelliJ is not able to delete file in project, it throws an JavaioException. And maybe could be the reason why it cannot rewrite settings.
Some advice?
We need the logs to investigate, please see above.
here there is the log: https://pastebin.com/raw/U0XU9r3D
Can't find anything related in idea.log. Please provide build.log with debug info enabled. Forums doesn't support non-image attaches, it may be more convenient if you report an issue at https://youtrack.jetbrains.com/issues/IDEA and attach the logs there.
Here there is the build-log : https://pastebin.com/raw/QfF7We0h
and the build-properties: https://pastebin.com/raw/cGh6uLgK
However I do not find any error, I think that the problem is related to some permission, but I do not want to format my Computer for that and I must use IntelliJ due to reasons regarding the context
Any advice, you think that running it on a virtual machine would help?
Try moving the project to a different location.
See if relocating IDE folders helps: https://intellij-support.jetbrains.com/hc/articles/207240985.
When I tried to do that IntelliJ says that the file does not exist, it creates it empty and I do not know how to modify it.
(Posted the issue on the website)
Moving the project directory to a different locations has solved the problem for now, I really thank you for that you saved my day, hope that will work forever.
I am having a similar problem that reactor-core is not being resolved by Intellij version 2019.3.2 Community Version while Gradle builds fine on command line. IntelliJ has no problems resolving all other dependencies/artifacts from JFrog artifactory. Moving project diredctory to a different location does NOT solve the problem.
compile group: 'io.projectreactor', name: 'reactor-core', 3.3.5.RELEASE
Jinvest1211 What is the exact error? Does it help to remove .idea directory and re-import the project selecting the build.gradle file?
Please share build.log and idea.log here, or at YouTrack by creating new issue: https://youtrack.jetbrains.com/newIssue?project=IDEA
ERROR - intellij.openapi.progress.Task - org/jetbrains/plugins/gradle/util/GradleConstants
java.lang.NoClassDefFoundError: org/jetbrains/plugins/gradle/util/GradleConstants
at com.jfrog.ide.idea.GradleDependenciesDataService.importData(GradleDependenciesDataService.java:47)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.doImportData(ProjectDataManagerImpl.java:287)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:155)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:241)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:248)
at com.intellij.openapi.externalSystem.importing.ImportSpecBuilder$DefaultProjectRefreshCallback.onSuccess(ImportSpecBuilder.java:145)
at com.intellij.openapi.externalSystem.service.project.ExternalProjectRefreshCallback.onSuccess(ExternalProjectRefreshCallback.java:40)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.handExecutionResult(ExternalSystemUtil.java:563)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.executeImpl(ExternalSystemUtil.java:543)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.lambda$execute$1(ExternalSystemUtil.java:392)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:150)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:392)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:647)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:888)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(CoreProgressManager.java:402)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:221)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:402)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.plugins.gradle.util.GradleConstants PluginClassLoader[org.jfrog.idea, 1.6.1] com.intellij.ide.plugins.cl.PluginClassLoader@5d1564bb
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:77)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 28 more
ERROR - intellij.openapi.progress.Task - org/jetbrains/plugins/gradle/util/GradleConstants
https://plugins.jetbrains.com/plugin/9834-jfrog plug-in seems to be the culprit. Disable the plug-in and see if it helps.
2020-11-24 20:20:29,879 [ 738426] ERROR - intellij.openapi.progress.Task - IntelliJ IDEA 2019.3.2 Build #IC-193.6015.39
2020-11-24 20:20:29,879 [ 738426] ERROR - intellij.openapi.progress.Task - JDK: 11.0.5; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-11-24 20:20:29,880 [ 738427] ERROR - intellij.openapi.progress.Task - OS: Windows 10
2020-11-24 20:20:29,880 [ 738427] ERROR - intellij.openapi.progress.Task - Plugin to blame: JFrog version: 1.6.1
2020-11-24 20:20:29,880 [ 738427] ERROR - intellij.openapi.progress.Task - Last Action: ExternalSystem.RefreshAllProjects
2020-11-24 20:20:30,001 [ 738548] INFO - ge.ExternalProjectsDataStorage - Save external projects data in 20 ms
2020-11-24 20:20:40,064 [ 748611] INFO - ateSettings.impl.UpdateChecker - connect timed out
java.net.SocketTimeoutException: connect timed out
at java.base/java.net.PlainSocketImpl.waitForConnect(Native Method)
at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:107)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:285)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:265)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1227)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515)
at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:334)
at com.intellij.util.io.HttpRequests.openConnection(HttpRequests.java:607)
at com.intellij.util.io.HttpRequests.access$300(HttpRequests.java:56)
at com.intellij.util.io.HttpRequests$RequestImpl.getConnection(HttpRequests.java:376)
at com.intellij.util.io.HttpRequests$RequestImpl.getInputStream(HttpRequests.java:385)
at com.intellij.util.io.HttpRequests$RequestImpl.getReader(HttpRequests.java:403)
at com.intellij.util.io.HttpRequests$RequestImpl.getReader(HttpRequests.java:396)
at com.intellij.openapi.updateSettings.impl.UpdateChecker$checkPlatformUpdate$updateInfo$1.process(UpdateChecker.kt:164)
at com.intellij.openapi.updateSettings.impl.UpdateChecker$checkPlatformUpdate$updateInfo$1.process(UpdateChecker.kt:50)
at com.intellij.util.io.HttpRequests.doProcess(HttpRequests.java:518)
at com.intellij.util.io.HttpRequests.process(HttpRequests.java:500)
at com.intellij.util.io.HttpRequests.access$100(HttpRequests.java:56)
at com.intellij.util.io.HttpRequests$RequestBuilderImpl.connect(HttpRequests.java:350)
at com.intellij.openapi.updateSettings.impl.UpdateChecker.checkPlatformUpdate(UpdateChecker.kt:164)
at com.intellij.openapi.updateSettings.impl.UpdateChecker.doUpdateAndShowResult(UpdateChecker.kt:119)
at com.intellij.openapi.updateSettings.impl.UpdateChecker.access$doUpdateAndShowResult(UpdateChecker.kt:50)
at com.intellij.openapi.updateSettings.impl.UpdateChecker$updateAndShowResult$1.run(UpdateChecker.kt:81)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
> 2020-11-24 20:20:29,880 [ 738427] ERROR - intellij.openapi.progress.Task - Plugin to blame: JFrog version: 1.6.1
I tried deleting the .idea folder and reimporting. It did not resolve the issue. I also disabled JFrog plugIn and restarted Intellij. The issue remains the same.
2020-11-24 20:20:29,879 [ 738426] ERROR - intellij.openapi.progress.Task - org/jetbrains/plugins/gradle/util/GradleConstants
java.lang.NoClassDefFoundError: org/jetbrains/plugins/gradle/util/GradleConstants
at com.jfrog.ide.idea.GradleDependenciesDataService.importData(GradleDependenciesDataService.java:47)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.doImportData(ProjectDataManagerImpl.java:287)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:155)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:241)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManagerImpl.importData(ProjectDataManagerImpl.java:248)
at com.intellij.openapi.externalSystem.importing.ImportSpecBuilder$DefaultProjectRefreshCallback.onSuccess(ImportSpecBuilder.java:145)
at com.intellij.openapi.externalSystem.service.project.ExternalProjectRefreshCallback.onSuccess(ExternalProjectRefreshCallback.java:40)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.handExecutionResult(ExternalSystemUtil.java:563)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.executeImpl(ExternalSystemUtil.java:543)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.lambda$execute$1(ExternalSystemUtil.java:392)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:150)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:392)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:647)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:888)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(CoreProgressManager.java:402)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:221)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:402)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.plugins.gradle.util.GradleConstants PluginClassLoader[org.jfrog.idea, 1.6.1] com.intellij.ide.plugins.cl.PluginClassLoader@5d1564bb
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:77)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 28 more
The project has the need to download artifacts from JFrog artifactory.
The plug-in doesn't work correctly, you need to disable it. If the build works from the command line Gradle, you don't need any plug-in to work with it in IntelliJ IDEA. You can also contact plug-in maintainer for help.
> I also disabled JFrog plugIn and restarted Intellij. The issue remains the same.
The stacktrace shows that the plug-in is still enabled.
For testing purpose,I created on my personal laptop a bare bone Intellij Gradle project with the following dependencies. Everything works perfectly fine in Intellij. It is only when intellij tries to extract artifacts from company JFrog factory that the error happens. What puzzles me is that it only complains about a couple of artifacts while having no problems with tens of other artifacts. If it were permission issue, it would block the project from accessing all artifacts equally.
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
// https://mvnrepository.com/artifact/org.springframework.retry/spring-retry
compile group: 'org.springframework.retry', name: 'spring-retry', version: '1.3.0'
// https://mvnrepository.com/artifact/io.projectreactor/reactor-core
compile group: 'io.projectreactor', name: 'reactor-core', version: '3.3.5.RELEASE'
}
If the issue occurs with the clean install and no third-party plug-ins only in IntelliJ IDEA while it works fine in the command line, please file a bug at https://youtrack.jetbrains.com/newIssue?project=IDEA, attach a sample project to reproduce zipped and the logs via Help | Collect Logs and Diagnostic Data.
I ran into these same issues with 2021.1 and 2020.3. The problem was that I was selecting "Project From Existing Sources..." and then in the Import Project dialog "Create project from existing sources", instead of "Import project from external model > Gradle". Once I change that, everything worked great.
Asa Atallah thanks....your suggestion resolved my issue