My Pom.xml setting for maven plugin is
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>3.0</version>
<!-- Note that we're executing the Flyway
plugin in the "generate-sources" phase -->
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>migrate</goal>
</goals>
</execution>
</executions>
<!-- Note that we need to prefix the db/migration
path with filesystem: to prevent Flyway
from looking for our migration scripts
only on the classpath -->
<configuration>
<baselineOnMigrate>true</baselineOnMigrate>
<url>databaseUrl</url>
<user>username</user>
<password>password</password>
<schemas>
<schema>schema_name</schema>
</schemas>
<locations>
<location>filesystem:src/main/resources/db/migration</location>
</locations>
</configuration>
</plugin>
While running mvn clean install I am getting below error
Failed to execute goal org.flywaydb:flyway-maven-plugin:3.0:migrate (default) on project Test: org.flywaydb.core.api.FlywayException: Found non-empty schema "schema_name" without metadata table! Use init() or set initOnMigrate to true to initialize the metadata table. -> [Help 1]
What am I missing here? I tried some changes like adding baselineOnMigrate but it did not work.