Open dsyer opened 2 years ago
If you guys feel strongly about this issue, please vote for https://github.com/gradle/gradle/issues/23032. We can't do anything until this is fixed upstream.
Looks like the linked issue has now been resolved - does this unblock things now? Many thanks.
Is there any way to try it? The current "pre-release" version of VSCode extension doesn't fix the problem.
@dsyer you may want to take a look at https://github.com/redhat-developer/vscode-java/issues/1615#issuecomment-1512864529
I tried that. It didn’t solve anything for me. Maybe I missed a step. Please feel free to add a PR to my project.
https://github.com/redhat-developer/vscode-java/issues/1615#issuecomment-1512864529 can change the output folder from bin
to build
, but it can't solve the issue mentioned in https://github.com/eclipse/buildship/issues/1236
@dsyer could you try the following patch:
diff --git a/build.gradle b/build.gradle
index 478a825..0fc7bb6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,6 +2,7 @@ plugins {
id 'org.springframework.boot' version '2.6.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
+ id 'eclipse'
}
group = 'com.example'
@@ -36,4 +37,11 @@ task metaProperties() {
props.setProperty("version", "${project.version}")
props.store(output.newOutputStream(), null)
}
-}
\ No newline at end of file
+}
+
+eclipse {
+ synchronizationTasks processResources
+ classpath {
+ defaultOutputDir = file('build/resources/main')
+ }
+}
This patch work for me, thank you. I'm not sure if it breaks anything else, since it seems to change the default settings of the eclipse plugin. I'm also not sure why it's different to #1615.
i also tried (with today's setup) this, @dsyer : At no avail/works like charm! (Though it took some time unitl "gradle" and "java" came up...but once the "build folders" (as the "play buttons" on tests) are available:
634 is the underlying issue, but that was closed by brushing it under the carpet (IMO it deserves to be fixed). The problem I have is actually worse - the classpath is incomplete because it doesn't contain resources created and/or copied into
build/resources/main
(for instance) by script targets in the build. It's easy to reproduce the problem - here's an example: https://github.com/scratches/vscode-gradle-nonsense (load it up in VSCode and try and run the tests from the codelens and they fail, even though the build succeeds from command line).See also https://github.com/microsoft/vscode-java-debug/issues/1127