Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jakarta.validation-api dependency added while upgrading Spring Petclinic example #542

Closed
BoykoAlex opened this issue Jun 20, 2024 · 0 comments · Fixed by #543
Closed

jakarta.validation-api dependency added while upgrading Spring Petclinic example #542

BoykoAlex opened this issue Jun 20, 2024 · 0 comments · Fixed by #543
Labels
bug Something isn't working

Comments

@BoykoAlex
Copy link
Contributor

The jakarta.validation-api dependency shouldn't be present while upgrading Spring Petclinic to Boot 3.x. This dependency is transitive coming in via spring-boot-validation-starter.

The problem is that first javax validation-api dependency added explicitly. Then the validation-api is transformed into jakarta.validation-api.

I'd try to work with the problem of adding javax validation-api. It is added via
org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_0 -> org.openrewrite.java.spring.boot2.MigrateHibernateConstraintsToJavax

Namely this bit of YAML:

  - org.openrewrite.java.dependencies.AddDependency:
      groupId: javax.validation
      artifactId: validation-api
      version: 2.x
      onlyIfUsing: javax.validation.constraints.*

At this moment the petclinic is on Boot 2.7.x which is on jakarta.validation-api version 2.0.x already. Consequently, the old validation-api dependency has no issues to be added.

Wonder if there is a condition in the YAML recipe that could prevent execution of recipes under 2.7.x for the 2.7.x project that we could add in spring upgrade yaml recipes...

Anything you can recommend @timtebeek and @sambsnyd ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant