spring-io / start.spring.io

https://start.spring.io
Apache License 2.0
2.16k stars 885 forks source link

Configure compiler to use -parameters flag #1453

Closed rwinch closed 2 months ago

rwinch commented 2 months ago

I think that it would be valuable if generated projects were automatically configured (in Gradle & Maven) to use the -parameters flag since Spring Framework 6.1 removed support for -debug fallback.

wilkinsona commented 2 months ago

Thanks for the suggestion. Spring Boot's Maven and Gradle plugins already do this.

rwinch commented 2 months ago

Can it be updated to work with the IDEs as well?

wilkinsona commented 2 months ago

We configure Maven's compiler plugin and Gradle's JavaCompile tasks to compile with parameter information. Getting that information out of the build system and into the IDE is out of our control. If it isn't working, it should be reported to the IDE developers.

rwinch commented 2 months ago

That's disappointing. I guess I thought that if the build tool could be configured, then the IDE could be too. Based upon my observations this new requirement has been a pretty big disruption to Spring users, so I was hoping to alleviate that wherever possible.

wilkinsona commented 2 months ago

It should work out of the box with IntelliJ as it delegates compilation to Gradle and all of Gradle's configuration then applies. If you're not delegating to Gradle then I think https://youtrack.jetbrains.com/issue/IDEA-154038/IDEA-doesnt-respect-Gradle-compiler-settings is the relevant issue. On the Eclipse side, I think https://github.com/eclipse/buildship/issues/1070 is the relevant issue.

wilkinsona commented 2 months ago

I guess I thought that if the build tool could be configured, then the IDE could be too

We might be able to configure Eclipse from within Boot's Gradle plugin. I'm not sure that there's anything we could do on the Maven side. Reading around, I don't think there's anything we can do for IntelliJ with Maven or Gradle that would work broadly enough. Given all of these caveats, I think this really ought to be fixed in the IDEs or their plugins so that everyone can benefit from build system compiler args being honoured by the IDE.