You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's already managed with Spring Initializr.
If you had dependencies PostgreSQL Driver and Flyway Migration, the dependency flyway-database-postgresql is automatically added.
Question
Is it possible to conditionally add a Maven dependency, depending of the presence of other dependencies ?
Is it possible to conditionally add a Maven dependency, depending of the presence of other dependencies ?
Yes absolutely! Preconditions are the way to go there; For an example look at how we use DependencyInsight as a precondition here to check for the presence of another dependency, and if found run a different recipe to actually make changes. openrewrite/rewrite-migrate-java@110db88
I imagine this would only take a couple lines of yaml to resolve; would you be open to add that as a contribution?
Awesome, yes thanks! From the example at openrewrite/rewrite-migrate-java@110db88 I suspect it'll pretty much be a copy and paste with minimal changes. Writing a test could even be optional here, as we're just reusing existing components.
What problem are you trying to solve?
Flyway has been upgraded to version 10 with Spring Boot 3.3.
Some changes have to be made for this upgrade, as explained here : https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.3-Release-Notes#flyway-10
Example with Postgresql driver and Flyway
Dependencies needed with Spring Boot 3.2
Dependencies needed with Spring Boot 3.3
Testing Spring Initializr
It's already managed with Spring Initializr.
If you had dependencies PostgreSQL Driver and Flyway Migration, the dependency flyway-database-postgresql is automatically added.
Question
Is it possible to conditionally add a Maven dependency, depending of the presence of other dependencies ?
See also
The text was updated successfully, but these errors were encountered: