-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add IDE setup documentation for VS Code and Eclipse #17846
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
Open
Inder782
wants to merge
1
commit into
spring-projects:main
from
Inder782:docs/ide-import-instructions
+44
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
docs/modules/ROOT/pages/features/integrations/ide-setup.adhoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
= IDE Setup for Eclipse and VSCode | ||
|
||
This guide describes how to set up and import the project into Eclipse and VSCode, ensuring smooth development even with complex Gradle dependencies. | ||
|
||
== Why Custom Eclipse Plugin? | ||
|
||
This project contains cycles in Gradle dependencies (especially between main and test sources) that do not affect Gradle builds but can confuse IDEs when generating project metadata. A custom Eclipse plugin relaxes classpath rules, removes problematic references, and ensures both Eclipse and VSCode can import the project cleanly. | ||
|
||
== VSCode: Disable Automatic Gradle Import | ||
|
||
VSCode's default Gradle import can fail due to project cycles and Buildship limitations. To prevent this, `.vscode/settings.json` disables automatic Gradle import: | ||
[source,json] | ||
---- | ||
{ | ||
"java.import.gradle.enabled": false | ||
} | ||
---- | ||
|
||
== Eclipse: Relax Classpath Rules | ||
|
||
The custom plugin updates `.classpath`: | ||
- Cycles and incomplete classpath errors are downgraded to warnings. | ||
- Test code dependencies are handled smoothly. | ||
- References to build output folders without sources are removed. | ||
|
||
== Excluding xml-apis from Test Dependencies | ||
|
||
Some test dependencies (e.g., HtmlUnit, Selenium) include `xml-apis`, which are now part of the JDK and can cause warnings in Eclipse. These are excluded in the Gradle test configuration. | ||
|
||
== Manual Import Workflow | ||
|
||
1. Clean your workspace: | ||
+ | ||
[source,sh] | ||
---- | ||
git clean -fxd | ||
./gradlew clean build cleanEclipse eclipse -x checkstyleNohttp -x test -x integrationTest | ||
---- | ||
2. Import the generated Eclipse metadata into Eclipse or VSCode manually. | ||
3. Do not use Buildship's automatic import in VSCode. | ||
|
||
== Summary | ||
|
||
These changes ensure contributors can import and work with the project in Eclipse and VSCode without IDE errors caused by Gradle dependency cycles or unnecessary classpath entries. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.