Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
How to run Flyway migrate before jOOQ code generation using Spring Boot?

I'm trying to use Flyway and jOOQ together with Spring Boot (spring-boot-starter-jooq and autoconfigured Flyway both handled by Spring)

My problem is that the jOOQ code generation runs before Flyway migrate, so jOOQ doesn't see the changes made by Flyway.

I tried setting dependsOn for the jOOQ generator task to flywayMigrate but as it turns out Flyway is run only on startup. The Flyway Gradle plugin is not applied, so I have no flywayMigrate task.

When I tried adding it to my gradle config following the official Flyway guide:

apply plugin: "org.flywaydb.flyway"

flyway {
    url = 'jdbc:postgresql://localhost:5432/myDb'
    user = 'myUsr'
    password = 'mySecretPwd'
    schemas = ['public']
}

I get an exception:

java.lang.NoClassDefFoundError: org.flywaydb.core.internal.util.jdbc.DriverDataSource

What am I doing wrong? How do I set this up so they work together nicely?

Note that I have the PostgreSQL driver and Flyway Core as a dependency:

implementation "org.postgresql:postgresql:42.2.5"
implementation "org.flywaydb:flyway-core"

so it should work. This is probably a Gradle vs Flyway vs Spring issue, because Flyway works when I start up my Spring app.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda