question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FlywayException: Unable to determine URL for classpath location: db/migration

See original GitHub issue

I’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&amp;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:closed
  • Created 9 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

21reactions
axelfontainecommented, May 30, 2014

Your folder is called src/main/resources/db.migration . It should be src/main/resources/db/migration .

0reactions
madukancommented, Aug 22, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found