FlywayException: Unable to determine URL for classpath location: db/migration
See original GitHub issueI’ve added maven dependency for flyway 3.0 to my test console application and couldn’t run migration neither from maven plugin nor from spring context.
plugin configuration is:
<plugin>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.27</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<url>jdbc:mysql://localhost/addressbook?useUnicode=yes&characterEncoding=UTF-8</url>
<driver>com.mysql.jdbc.Driver</driver>
<user>root</user>
<password>root</password>
<schemas>
<schema>addressbook</schema>
</schemas>
</configuration>
At first I build my project:
mvn clean package
then run flyway maven plugin:
mvn compile flyway:migrate
The maven output log is :
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:3.0:migrate (compile) on project addressbook: org.flywaydb.core.api.FlywayException: Unable to scan for SQL migrations in location: classpath:db/migration: Unable to determine URL for classpath location: db/migration (ClassLoader: ClassRealm[plugin>org.flywaydb:flyway-maven-plugin:3.0, parent: sun.misc.Launcher$AppClassLoader@530f243b])
Into web application flyway migration works fine both on 3.0 and 2.3.1
OS: Linux Mint. DB:MySQL.
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Flyway: Unable to determine URL for classpath location
Now If I let the property flyway.locations unchanged and keep my sql migration scripts in filesystem:Flyway-INSTALL-DIR/sql it is working fine. Could anyone ...
Read more >Locations - Flyway by Redgate • Database Migrations Made ...
Comma-separated list of locations to scan recursively for migrations. The location type is determined by its prefix. Classpath. Unprefixed locations or ...
Read more >Java – FlywayException: Unable to scan for SQL migrations in ...
Java – FlywayException: Unable to scan for SQL migrations in location: classpath:db/ ... error: Unable to determine URL for classpath location: db/migration ......
Read more >Database Migrations with Flyway - Baeldung
The above configuration specifies that our migration scripts are located in the db/migration directory. It connects to an in-memory H2 instance ...
Read more >Using Flyway - Quarkus
The location type is determined by its prefix. Unprefixed locations or locations starting with classpath: point to a package on the classpath and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your folder is called src/main/resources/db.migration . It should be src/main/resources/db/migration .
I found it to be a silly issue in my test project. Some initial documentation suggested db/migrations, but I was actually using db/migration under my spring boot configuration. bummer – that extra s caused such a havoc… lol!