Is there a recommended way to build a ktor jar file with a Flyway dependency? I would have preferred just using the ktor gradle plugin, but I couldn’t find a way to include the META_INF/services directory which Flyway requires. I ended up having to pull in ShadowJar and use
mergeServiceFiles()
.
m
maaxgr
06/12/2024, 6:11 AM
We are using shadowJar as well at our company
a
Anders Sveen
06/12/2024, 6:29 AM
Not sure what the problem is... 🙂 We're at least using Flyway without issues. Migration code:
Copy code
Flyway.configure().dataSource(datasource).load().apply {
info().pending().apply {
if (isNotEmpty()) {
<http://logger.info|logger.info>("Migrations being applied: $this")
} else {
<http://logger.info|logger.info>("No migrations to apply")
}
}
migrate()
}
Flyway as normal dependency in Gradle. And then ShadowJar: