spring-projects / spring-authorization-server

Spring Authorization Server
https://spring.io/projects/spring-authorization-server
Apache License 2.0
4.78k stars 1.25k forks source link

Samples: gradle subprojects are not included into root project #1645

Closed alexanderankin closed 2 weeks ago

alexanderankin commented 2 weeks ago

Describe the bug I tried to clone the repo and run the samples, but was unable to load the sample projects in my IDE without modifying build files.

To Reproduce use git to clone the repo, the open the folder in intellij.

Expected behavior I expected to see some projects listed out in settings.gradle and the IDE would load them, e.g.

// settings.gradle
rootProject.name = ""
include(':some:path:to:project') // meaning 'some/path/to/project' is a directory containing 'build.gradle'

Sample

I had to add this to get it to load on my end, hopefully just missing something, but in case its not obvious, I wanted to make this ticket for future reference for newcomers like myself:

include(":samples:default-authorizationserver")
findProject(":samples:default-authorizationserver").buildFileName = "samples-default-authorizationserver.gradle"
include(":samples:demo-authorizationserver")
findProject(":samples:demo-authorizationserver").buildFileName = "samples-demo-authorizationserver.gradle"
include(":samples:demo-client")
findProject(":samples:demo-client").buildFileName = "samples-demo-client.gradle"
include(":samples:messages-resource")
findProject(":samples:messages-resource").buildFileName = "samples-messages-resource.gradle"
include(":samples:users-resource")
findProject(":samples:users-resource").buildFileName = "samples-users-resource.gradle"
include(":samples:x509-certificate-generator")
findProject(":samples:x509-certificate-generator").buildFileName = "samples-x509-certificate-generator.gradle"
jgrandja commented 2 weeks ago

@alexanderankin The sample projects are loaded from this part of the script in settings.gradle:

https://github.com/spring-projects/spring-authorization-server/blob/314a41b321ab77f6e9a8b479fd49566718e89784/settings.gradle#L37

This has been in place for quite some time now and no issues have been reported.

There is something going on with your environment setup.

I'm going to close this but if you need further help please reach out here and provide as much detail as possible.