fix(pom): re-enable -parameters compiler flag#1
Merged
Conversation
Commit d43152f ("remove unused maven plugins") dropped the maven-compiler-plugin <parameters>true</parameters> configuration, assuming it was unused. It is not: Spring relies on formal parameter names being present in the bytecode to resolve constructor/method injection by name — e.g. to disambiguate two beans of the same type by the parameter name, and to bind @RequestParam/@PathVariable/@ConfigurationProperties without an explicit name. Spring Boot's own parent enables -parameters by default for exactly this reason. Without the flag, downstream Spring projects fail at ApplicationContext load with NoUniqueBeanDefinitionException (observed in spring-services after bumping to parent 1.2.0: two JsonAuthenticationEntryPoint beans could no longer be told apart). Re-added as the maven.compiler.parameters property (honored by maven-compiler-plugin 3.15.0), consistent with how maven.compiler.source/target are declared. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hendrikebbers
added a commit
to OpenElementsLabs/spring-services
that referenced
this pull request
Jul 16, 2026
…ualifier SecurityConfig defines two beans of type JsonAuthenticationEntryPoint (jwtAuthenticationEntryPoint, apiKeyAuthenticationEntryPoint) and relied on the injection-point parameter name matching the bean name to pick the right one. That only works when classes are compiled with -parameters; the org parent stopped providing that flag in 1.2.0, so the ApplicationContext failed to load with NoUniqueBeanDefinitionException (103 test errors). Resolve the ambiguity explicitly with @qualifier instead of relying on parameter-name magic, so the wiring is correct and self-documenting regardless of the compiler flag. The parent is separately being fixed to re-enable -parameters (OpenElementsLabs/java-parent#1), but this makes the security config robust on its own. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hendrikebbers
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Commit d43152f ("remove unused maven plugins from pom.xml to streamline build configuration") removed the
maven-compiler-pluginconfiguration:on the assumption it was unused. It is not unused. Spring relies on formal parameter names being present in the bytecode (
-parameters) to:@RequestParam/@PathVariablewithout an explicitname,@ConfigurationPropertiesconstructor binding.Spring Boot's own
spring-boot-starter-parentenables-parametersby default for exactly this reason.Impact
After bumping
spring-servicesto parent1.2.0, the wholespring-services-coretest suite failed atApplicationContextload (103 errors):Two beans of the same type could no longer be told apart, because Spring's by-name fallback needs the parameter names that
-parameterspreserves.Fix
Re-add the flag as the
maven.compiler.parametersproperty (honored bymaven-compiler-plugin3.15.0), consistent with howmaven.compiler.source/maven.compiler.targetare declared.Verification
Built
spring-servicesagainst this patched parent (1.3.0-SNAPSHOT): the previously-failing module now passes — 294 tests, 0 errors, BUILD SUCCESS.🤖 Generated with Claude Code