Skip to content
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

Make eclipse/vscode project import work #12930

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

jvalkeal
Copy link
Contributor

  • Gradle projects contain cycles which comes from dependencies to test sources which is not a problem in gradle but eclipse metadata generation is getting confused. Thus we need settings to relax errors org.eclipse.jdt.core.circularClasspath=warning org.eclipse.jdt.core.incompleteClasspath=warning
  • Additionally .classpath entries needs to be changes having without_test_code=false test=false
  • Aspects end up getting source dirs build/classes/java/main and build/resources/main which never have sources. Vscode complains about that, eclipse is fine. Remove those from entries.
  • In tests htmlunit depends on xml-apis. xml-apis are now part of jdk and eclipse complains about that. Excluse these in a gradle build.
  • Both eclipse and vscode don't currently work with buildship, due to project cycles and buildship cannot be configured. It's possible to create metadata from eclipse task manually which then can be imported. For this we need to disable automatic import in vscode using buildship. This goes to .vscode/settings.json workspace config.
  • Then with these changes user can do something like git clean -fxd && ./gradlew clean build cleanEclipse eclipse -x checkstyleNohttp -x test -x integrationTest and import projects manually.

@jvalkeal
Copy link
Contributor Author

Eclipse imports cleanly
spring-security-eclipse-import-1

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 27, 2023
@jvalkeal
Copy link
Contributor Author

STS still has old validations which cannot be turned off spring-projects/sts4#1016

Something to fix later as we have some real validation errors in some xml files.

spring-security-sts-import-1

@jvalkeal
Copy link
Contributor Author

vscode imports cleanly

spring-security-vscode-import-1

@marcusdacoregio
Copy link
Contributor

Hi @jvalkeal, I remember @rwinch comment about applying those changes to 5.7.x and merging them all the way up to main. Have you considered that?

- Gradle projects contain cycles which comes from dependencies to
  test sources which is not a problem in gradle but eclipse metadata
  generation is getting confused. Thus we need settings to relax errors
  org.eclipse.jdt.core.circularClasspath=warning
  org.eclipse.jdt.core.incompleteClasspath=warning
- Additionally .classpath entries needs to be changes having
  without_test_code=false
  test=false
- Aspects end up getting source dirs `build/classes/java/main`
  and `build/resources/main` which never have sources. Vscode complains
  about that, eclipse is fine. Remove those from entries.
- In tests `htmlunit` depends on `xml-apis`. `xml-apis` are now part
  of jdk and eclipse complains about that. Excluse these in a gradle build.
- Both eclipse and vscode don't currently work with buildship, due to
  project cycles and buildship cannot be configured. It's possible to
  create metadata from `eclipse` task manually which then can be imported.
  For this we need to disable automatic import in vscode using buildship.
  This goes to `.vscode/settings.json` workspace config.
- Then with these changes user can do something like
  git clean -fxd && ./gradlew clean build cleanEclipse eclipse -x checkstyleNohttp -x test -x integrationTest
  and import projects manually.
@jvalkeal jvalkeal changed the base branch from main to 6.0.x May 16, 2023 08:31
@jvalkeal
Copy link
Contributor Author

I rebased and force pushed this PR branch atop of 6.0.x. That is an oldest branch we have any change of using eclipse/vscode. 5.x creates multiple jars from a saml project using gradle features and that would not work as eclipse only understands single classpath per project.

@jzheaux jzheaux self-assigned this Jun 5, 2023
@jzheaux jzheaux added in: build An issue in the build type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 5, 2023
@jzheaux jzheaux added this to the 6.0.4 milestone Jun 5, 2023
@jzheaux jzheaux merged commit c053f6f into spring-projects:6.0.x Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: build An issue in the build type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants