Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs while import.gradle is disabled
I see error "Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs" of my maven project despite "java.import.gradle.enabled": false is in my .vscode/settongs.json.
There is still gradlew and build.gradle files, but they are not intended to be used for building java project.
Environment
- Operating System: rhel 7
- JDK version: 8
- Visual Studio Code version: 1.55
- Java extension version: 0.76.0
BTW I also see such errors in log:
[Warn - 4:50:56 PM] Apr 6, 2021, 4:50:56 PM Failed to detect project changes
SynchronizingBuildScriptUpdateListener failed
org.eclipse.core.runtime.CoreException: SynchronizingBuildScriptUpdateListener failed
at org.eclipse.buildship.core.internal.workspace.SynchronizingBuildScriptUpdateListener$1.visit(SynchronizingBuildScriptUpdateListener.java:75)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:51)
at org.eclipse.buildship.core.internal.workspace.SynchronizingBuildScriptUpdateListener.visitDelta(SynchronizingBuildScriptUpdateListener.java:68)
at org.eclipse.buildship.core.internal.workspace.SynchronizingBuildScriptUpdateListener.resourceChanged(SynchronizingBuildScriptUpdateListener.java:55)
at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:305)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:295)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:158)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:380)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1502)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2306)
at org.eclipse.core.internal.events.NotificationManager$NotifyJob.run(NotificationManager.java:44)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Can't read root project location for project located at /data/XXXXX/myproject
at org.eclipse.buildship.core.internal.configuration.BuildConfigurationPersistence.readPathToRoot(BuildConfigurationPersistence.java:90)
at org.eclipse.buildship.core.internal.configuration.DefaultConfigurationManager.loadProjectConfiguration(DefaultConfigurationManager.java:114)
at org.eclipse.buildship.core.internal.workspace.SynchronizingBuildScriptUpdateListener.isEnabledInPreferences(SynchronizingBuildScriptUpdateListener.java:63)
at org.eclipse.buildship.core.internal.workspace.SynchronizingBuildScriptUpdateListener.doVisitDelta(SynchronizingBuildScriptUpdateListener.java:85)
at org.eclipse.buildship.core.internal.workspace.SynchronizingBuildScriptUpdateListener.access$000(SynchronizingBuildScriptUpdateListener.java:44)
at org.eclipse.buildship.core.internal.workspace.SynchronizingBuildScriptUpdateListener$1.visit(SynchronizingBuildScriptUpdateListener.java:73)
... 14 more
@Yanpas could you try the following:
- close VS Code
- remove the .project, .classpath and .settings files/directories
- start VS Code
@snjeza I also get this error .
My use-case is a little different. What I have is a a pom.xml with multiple modules.
The error message is Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs
Same stack-trace as reported above.
Looking closer at this line
Caused by: org.eclipse.buildship.core.internal.GradlePluginsRuntimeException: Can't read root project location for project located at /[i snipped this]/junder/junder.model
The path junder/junder.model is pointing to the folder of one of my maven modules.
There was no .classpath file (which causes other problems), but removing the .project file and .settings directory did not help me. The problem persists.
After I created a new directory for my pom module and copied the scr directory and the pom file from the old directory and the problem went away. I did originally copy the entire folder from a gradle project.
Hi,
reproducing the problem with Gradle is quite easy, every time I add or remove a dependency from the build.gradle file the error:
Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs
appears.
To let the message to disappear with Java: Clean Java Language Server Workspace and a restart of VSC, the error goes away.
Environment:
- Version: 1.70.1
- Electron: 18.3.5
- Chromium: 100.0.4896.160
- Node.js: 16.13.2
- OS: Darwin x64 21.2.0
- Extension Pack for Java v0.25.2022072300
Thanks, S.
@foxpluto Is your project a Gradle project or not? And what's the value of your java.import.gradle.enabled?
@CsCherrYY yes, all my projects are Gradle projects and the value of java.import.gradle.enabled is enabled.
Did this means something to you?
Regards, S.