Question

I'm using Flyway to do database migrations from within Clojure. The problem I'm having is when I make an uberjar to deploy my application, Flyway can't find the migrations which are within the jar file. It works fine in development, without having the application packaged up. I tried a bunch of different combinations to add the migration sql files to the jar. I've unzipped the jar and all of the migrations are there, I'm not sure what the problem is.

Exception in thread "main" com.googlecode.flyway.core.api.FlywayException: Unable to determine URL for classpath location: db/migration

I'm using flyway version 2.1.1 and right now my migrations are in src/db/migration. I tried adding src/ to resource paths in the project.clj file but it still doesn't find them. Any ideas?

Was it helpful?

Solution

This happened because no directory entries were included in the jars/uberjars produced by leiningen up to the version 2.3.2, so ClassLoader#getResources("db/migration/") always returned null.

Will be fixed in leiningen 2.3.3 (Issue #1303).

OTHER TIPS

I wouldn't be surprised if this would fail because of the überjar, as there is currently no explicit support for this in the classpath scanner.

Please file an enhancement request in the issue tracker.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top