Skip to content

Skip spring-boot-starter-validation when jakarta.validation-api is present#993

Merged
timtebeek merged 1 commit intomainfrom
tim/fix-439
Apr 8, 2026
Merged

Skip spring-boot-starter-validation when jakarta.validation-api is present#993
timtebeek merged 1 commit intomainfrom
tim/fix-439

Conversation

@timtebeek
Copy link
Copy Markdown
Member

Summary

Test plan

  • AddsStarterValidationTest.shouldAddValidationStarterIfBVIsUsed — starter still added when no explicit validation API dep
  • AddsStarterValidationTest.shouldNotAddValidationStarterIfJakartaValidationApiPresent — starter skipped when jakarta dep present
  • AddsStarterValidationTest.shouldNotAddValidationStarterIfBVIsNotUsed — starter not added when constraints not used

…esent (#439)

Extract AddDependency for spring-boot-starter-validation into a sub-recipe
with a ModuleHasDependency precondition (invertMarking) so the starter is
not added when the project already declares jakarta.validation-api.
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Apr 8, 2026
@timtebeek timtebeek merged commit 82ad512 into main Apr 8, 2026
1 check passed
@timtebeek timtebeek deleted the tim/fix-439 branch April 8, 2026 16:01
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

upgradespringboot_2_3 must not add spring-boot-starter-validation if project has explicit [javax | jakarta].validation declared

1 participant