spring-projects / spring-security

Spring Security
http://spring.io/projects/spring-security
Apache License 2.0
8.73k stars 5.86k forks source link

Outdated CONTRIBUTING.adoc? #11668

Closed ch4mpy closed 2 years ago

ch4mpy commented 2 years ago

Describe the bug Following CONTRIBUTING.adoc is not enough to get an IDE ready to run unit-tests and contribute.

I could not get porject build and unit-tests run from Spring Too Suite 4 for Eclipse.

It seems that Kotlin resources were added and that referenced Groovy plugin version does not evolve with Eclipse releases.

Is Spring team is using only IntelliJ? Wouldn't pointing contributors to IntelliJ community edition be easier?

Also resources to configure IDEs with required code-formatting and import oredering rules would be of great help.

To Reproduce

Here is what I did

Here are some of the reported errors:

Description Resource    Path    Location    Type
One or more cycles were detected in the build path of project 'spring-security-config'. The paths towards the cycle and cycle are:
spring-security-config->{spring-security-ldap, spring-security-test}
->{spring-security-config, spring-security-ldap, spring-security-test}  spring-security-config      Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-itest-context'. The paths towards the cycle and cycle are:
spring-security-itest-context->{spring-security-config, spring-security-ldap, spring-security-test} spring-security-itest-context       Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-itest-ldap-embedded-apacheds-default'. The paths towards the cycle and cycle are:
spring-security-itest-ldap-embedded-apacheds-default->{spring-security-ldap, spring-security-test}
spring-security-itest-ldap-embedded-apacheds-default->{spring-security-config, spring-security-ldap, spring-security-test}  spring-security-itest-ldap-embedded-apacheds-default        Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-itest-ldap-embedded-mode-apacheds'. The paths towards the cycle and cycle are:
spring-security-itest-ldap-embedded-mode-apacheds->{spring-security-ldap, spring-security-test}
spring-security-itest-ldap-embedded-mode-apacheds->{spring-security-config, spring-security-ldap, spring-security-test} spring-security-itest-ldap-embedded-mode-apacheds       Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-itest-ldap-embedded-mode-unboundid'. The paths towards the cycle and cycle are:
spring-security-itest-ldap-embedded-mode-unboundid->{spring-security-ldap, spring-security-test}
spring-security-itest-ldap-embedded-mode-unboundid->{spring-security-config, spring-security-ldap, spring-security-test}    spring-security-itest-ldap-embedded-mode-unboundid      Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-itest-ldap-embedded-none'. The paths towards the cycle and cycle are:
spring-security-itest-ldap-embedded-none->{spring-security-ldap, spring-security-test}
spring-security-itest-ldap-embedded-none->{spring-security-config, spring-security-ldap, spring-security-test}  spring-security-itest-ldap-embedded-none        Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-itest-ldap-embedded-unboundid-default'. The paths towards the cycle and cycle are:
spring-security-itest-ldap-embedded-unboundid-default->{spring-security-ldap, spring-security-test}
spring-security-itest-ldap-embedded-unboundid-default->{spring-security-config, spring-security-ldap, spring-security-test} spring-security-itest-ldap-embedded-unboundid-default       Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-itest-web'. The paths towards the cycle and cycle are:
spring-security-itest-web->{spring-security-ldap, spring-security-test}
spring-security-itest-web->{spring-security-config, spring-security-ldap, spring-security-test} spring-security-itest-web       Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-ldap'. The paths towards the cycle and cycle are:
->{spring-security-ldap, spring-security-test}
->{spring-security-config, spring-security-ldap, spring-security-test}  spring-security-ldap        Build path  Build Path Problem
One or more cycles were detected in the build path of project 'spring-security-test'. The paths towards the cycle and cycle are:
->{spring-security-ldap, spring-security-test}
->{spring-security-config, spring-security-ldap, spring-security-test}  spring-security-test        Build path  Build Path Problem

Expected behavior Project imported and build, unit-tests ready to run from IDE.

Code format and import order rules configured correctly.

sjohnr commented 2 years ago

Hi @ch4mpy! Thanks for looking into this. I agree that there's probably some room for improvement in that document.

Is Spring team is using only IntelliJ? Wouldn't pointing contributors to IntelliJ community edition be easier?

I do believe the entire team is currently using IntelliJ, so that would be a good adjustment to mention.

Also resources to configure IDEs with required code-formatting and import oredering rules would be of great help.

This is something that's been on the To Do list for some time, but hasn't made it to the top of the list. I think the main thing that needs addressed is a consistent way to configure imports. Code formatting is handled by ./gradlew format, which would be good to mention as well.

Please see gh-11157. Since that issue was opened earlier, I'm going to close this as a duplicate. Feel free to add additional comments on that issue or to volunteer to take the issue and make a few updates to the doc based on your experience.

ch4mpy commented 2 years ago

@sjohnr , yes, ./gradlew format applies expected formatting but does not organize imports and IntelliJ community applies different formatting and import order than what is expeted from spring => each minor edit requires to manually organize imports and then run gradle format, which is quite time consuming (and cumbersome).

Having IntelliJ editor configuration files in Spring repos would be very handy (with the usage of Kotlin in projects, using other IDEs than Idea ones seams compromised)

darkedges commented 1 year ago

This is what I am getting in Spring STS 4.17 image Any ideas on how to fix all the reference issues?

ch4mpy commented 1 year ago

If you want the project to build, use Intellij (community edition is free) .

Using STS for any other Maven / Gradle project, I can understand your frustration, but I couldn't figure a way to have Kotlin modules build correctly.

darkedges commented 1 year ago

thanks @ch4mpy . The problem I have with Intellij is that I dont know how to link the various projects togethor so that I can develop in a cohesive manner. For example I am trying to develop an extension for Spring Authorization Server and it needs Spring Security to be there so that when I run my app it picks up the version I am developing as opposed to the version being dictacted by Spring Authorization Server.

I am already struggling, and the closest I have gotten is to publish jars locally from both projects and create a third project that uses them. This is not a nice development experience.

I know Eclispe, IntelliJ is a new learning curve that I don;t need ecspicially when there is a version of Eclipse developed by Spring that no Spring Developer uses. I have asked for help, as I am trying to help them with my extension, but so far tumbleweeds. Yes I appreciated it is the silly season and people are busy, but there needs to be a guide for how to develop the interdependencies so that we can make this a better prooduct,