Using a SQL style approach to Liquibase changesets (which is our codestyle, we don't use XML) I am trying to load an CSV file using the following SQL changeset
SQL
-- changeset user:insert-prices-data-temp-table
LOAD DATA LOCAL INFILE 'foo/src/main/resources/liquibase/changelogs/2021/prices.csv'
INTO TABLE prices_temp
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
When deploying the WAR file to Wildfly the following exception
java.io.FileNotFoundException: foo/src/resources/liquibase/changelogs/2021/prices.csv (No such file or directory) 2021-09-22T20:52:18.581085123Z at java.io.FileInputStream.open0(Native Method) 2021-09-22T20:52:18.581087214Z at java.io.FileInputStream.open(FileInputStream.java:195) 2021-09-22T20:52:18.581089768Z at java.io.FileInputStream.(FileInputStream.java:138) 2021-09-22T20:52:18.581092029Z at java.io.FileInputStream.(FileInputStream.java:93) 2021-09-22T20:52:18.581094150Z at com.mysql.jdbc.MysqlIO.sendFileToServer(MysqlIO.java:3772)
The Master Change log file references the 2021 directory with the SQL and CSV file existing in the same directory.
<includeAll path="liquibase/changelogs/2021/" filter="xml" errorIfMissingOrEmpty="true" />
I have tried the following other paths but they all still yield a FileNotFoundException
- prices.csv
- liquibase/changelogs/2021/prices.csv
- WEB-INF/classes/liquibase/changelogs/2021/CCC-220-marking-time-prices.csv
- (Absolute path) /home/xxxx/Work/foo-service/foo/src/main/resources/liquibase/changelogs/2021/prices.csv
Liquibase Version: 3.5.1
Wildfly Jboss Version : 21
I have checked the CSV file is present in the WAR file
Any ideas how to fix this?