Ensure kotlin compiler includes method param names#12641
Ensure kotlin compiler includes method param names#12641ruifigueira wants to merge 4 commits intospring-projects:masterfrom ruifigueira:bug/kotlinc-java-parameters
Conversation
|
Thanks for the PR, @ruifigueira. I suspect we need to do the same in Gradle too. Would you like to confirm that and make the necessary changes as part of this pull request? |
|
Sure, @wilkinsona. I found a similar PR (#9839) which is a great help, so I'll change |
|
Gradle plugin now enables |
This way, java parameters names are included in bytecode and can be retrieved using reflection. Fixes gh-12640
This commit documents the need of `-java-parameters` flag when compiling kotlin to ensure `Endpoint` method parameters names are available, as well as informing that `spring-boot-gradle-plugin` / maven with `spring-boot-starter-parent` do exactly that by default when activated. Fixes gh-12640
Using `javaParameters` configuration parameter in `kotlin-maven-plugin` instead of args: it is cleaner and users can add `args` to the plugin configuration without having to worry about adding `-java-parameters` Fixes gl-12640
|
Concourse CI doesn't seem to like me :) I was looking into those build errors and they are from and in another job, it is failing due to a Github Pull Request under build-deployment-tests > git-pull-request: I noticed that the first one is also occuring in the official Spring Boot master branch, so I'm assuming it has nothing to do with my changes. |
* gh-12641: Polish “Configure Kotlin compiler to use -java-parameters by default” Configure Kotlin compiler to use -java-parameters by default
|
Thanks very much for making your first contribution to Spring Boot, @ruifigueira. Especially one that was so complete. Sorry about the CI failures. I believe they were caused by a corrupted jar file from one of our snapshot dependencies. I've merged your changes into master along with a little bit of polish. Thanks again. |
Configures kotlin-maven-plugin to include the
-java-parametersargument, so that method parameter names are included in bytecode.
See gh-9323
Fixes gh-12640