Could not scan for SQL migration at location: classpath: db / migration

I use flyway for SQL migration, sql transition worked fine for me.

Now I'm trying to perform a simple Java migration using Flyway, below is the code that is used

package db.migration; import org.flywaydb.core.api.migration.jdbc.JdbcMigration; import java.sql.Connection; import java.sql.PreparedStatement; /** * Example of a Java-based migration. */ public class V2__Test implements JdbcMigration { public void migrate(Connection connection) throws Exception { PreparedStatement statement = connection.prepareStatement("create table test (id int)"); try { statement.execute(); } finally { statement.close(); } } } 

I created a Jar file from this class file and put the Jar file in the Flyway_home / Jars folder. Later I mentioned db / migration in the configuration file as shown below

 flyway.locations=db.migration 

After that, I ran the migrate command from cmd utility as shown below

 flyway -configFile=conf/flyway-fte-Data.conf migrate 

we get the following error

 ERROR: Unable to scan for SQL migrations in location: classpath:db/migration 

What is missing here can someone help me fix this.

Note. I do not use any plugin, its command line utility is just for passing.

Thanks in advance.

0
source share
1 answer

The 'flyway.locations' property sets the location of SQL migration files and you want to run java migration files. Therefore, I think this is enough when you comment on this property in your configuration, because the Flyway_home / jars folder is the default value for the Java migration location property ('flyway.jarDirs'). The next possibility is to set this property ('flyway.jarDirs') to your location in the bank.

+1
source

Source: https://habr.com/ru/post/1235217/


All Articles