-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate results in the classpath when using spring aot plugin #1236
Comments
Looks like this might be related: gradle/gradle#23032 (according to comments in redhat-developer/vscode-java#2344). Might even be fixed upstream already, but still broken for me in "pre-release" version of vscode extensions (redhat.java v1.18.2023041704)? |
@dsyer I guess you should use Gradle 8.1 first (the version is mentioned in the PR's milestone) and configure like the following snippet:
Unfortunately, it doesn't help. The generated files are under |
@CsCherrYY @dsyer You can try the following patch:
|
Why does Buildship want to use |
@dsyer you may want to take a look at #1131 (comment) |
From that it seems like changing the default is a bad idea - |
This is the same problem that was described in #1238. In this case, the |
Besides the "strange url" (
Vs Code: v1.78.0 >.\gradlew.bat --version
------------------------------------------------------------
Gradle 8.1.1
------------------------------------------------------------
Build time: 2023-04-21 12:31:26 UTC
Revision: 1cf537a851c635c364a4214885f8b9798051175b
Kotlin: 1.8.10
Groovy: 3.0.15
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.7 (Oracle Corporation 17.0.7+8-LTS-224)
OS: Windows 10 10.0 amd64
>.\gradlew.bat clean build
...
BUILD SUCCESSFUL in 18s
15 actionable tasks: 15 executed Is this OS-specific? Or rather (recently/unlcky timing) fixed by gradle/gradle#23032 -> redhat-developer/vscode-java#634 -> eclipse-jdtls/eclipse.jdt.ls#1108 ? |
It's not OS-specific. Did you run the tests in the IDE? I just checked in Codespaces and it's still broken with 1.78.1 and the latest Java extensions v0.25.1 (although I'm not sure if that includes the fixes you mentioned). |
Confirmative, @dsyer. I am on "release channel" (yesterday was a (code) update between the tests, but tests passed before&after..) |
I have all the same versions of extensions and it is still broken for me: test fails and
I also tried with pre-release versions. |
ok, now confirm: found the 2nd file(.txt) 🙈 but still: test passes! 😳 let's try in a "uniform" devcontainer!? (OS!?/side effects"!??) 🤔 |
Please send a PR for your suggested change at https://github.com/scratches/gradle-aot and/or open an issue there. |
I can reproduce on a (linux) dev container, but still not on (minimal, win) profile changing (source code) to
|
The Spring Boot Gradle plugin introduces additional source sets ( As long as the build ( When the functionality from the Spring AOT plugin is not needed during development in Eclipse you can remove the source sets and configurations in
Now, after invoking Refresh Gradle Project the The behavior of the Spring AOT plugin is not OS dependent. I can also reproduce this issue on Windows. |
Steps to Reproduce
./gradlew clean build
in the project root folderConfigTest
, you can see the errors.Expected Behavior
The test should succeed.
Current Behavior
The test fails due to the duplicate results in the classpath.

Context
It looks like the issue exists in the interaction between spring aot plugin and buildship/Gradle eclipse plugin. The aot plugin will add each source set's output to the runtime classpath. See : https://github.com/spring-projects/spring-boot/blob/5d49889bfde45ec0cf1d73b96ae61096add9dae7/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootAotPlugin.java#L78 and https://github.com/spring-projects/spring-boot/blob/5d49889bfde45ec0cf1d73b96ae61096add9dae7/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootAotPlugin.java#L92
The text was updated successfully, but these errors were encountered: