I'm trying out flyway and have an understanding problem concerning classpath and JARs.
I have a project with multiple services in multiple maven modules. I want each of the services to maintain its schema with flyway. So each service is a maven module with its own resource directory, where I could put the SQL scripts and which would be part of the JAR. Now, the service can run in embedded mode, where multiple service JARs are present in an end-user application (for example tomcat).
On service initialization I would run flyway migrate with each service's datasource. In case I use java migrations, I could keep the java classes in the same package as the impls and separate by locations, but in case I use SQL migrations, I would have something like this:
src/main/resources/db/migration/V1_1__Populate_table.sql
in each module. Now the question:
- Can flyway execute sql scripts from jars?
- If yes, can I specify which jars to execute?