Reputation: 21
I'm getting the below error when I gave the sql file location in the flyway plugin in jenkins.
If i give empty location it's working fine. It's automatically taking the default sql path.
If i give a specific location i'm getting the below error.
Building on master in workspace /var/lib/jenkins/workspace/flyway_test
$ /flyway/flyway -user=root ******** -url=jdbc:mysql://localhost:3306/test1 -locations=/flyway/sql/ migrate Flyway 4.2.0 by Boxfuse
Database: jdbc:mysql://localhost:3306/test1 (MySQL 5.6)
WARNING: Unable to resolve location classpath:flyway/sql
WARNING: Unable to resolve location classpath:flyway/sql
WARNING: Unable to resolve location classpath:flyway/sql
WARNING: Unable to resolve location classpath:flyway/sql
Successfully validated 3 migrations (execution time 00:00.028s)
Current version of schema test1
: 2
ERROR: java.lang.ArrayIndexOutOfBoundsException: -1
ERROR: Build step 'Invoke Flyway' failed due to errors.
Finished: FAILURE
flyway input
Upvotes: 2
Views: 1745
Reputation: 28106
Take a look at the description of the location
field in your configuration dialog. It says the same as it's said about the location
parameter in the flyway documentation
The location type is determined by its prefix. Unprefixed locations or locations starting with classpath: point to a package on the classpath and may contain both sql and java-based migrations.
Locations starting with filesystem: point to a directory on the filesystem and may only contain sql migrations.
That means, that you are providing the path within classpath, since you didn't add the prefix. If you want to add some filesystem resources, you need to specify it this way:
filesystem:/flyway/sql/
Upvotes: 3