0
我想在我的Ant項目中使用Flyway運行DDL腳本。我設法配置了類路徑,以便Flyway能夠看到遷移腳本。當我跑飛路:遷移任務,我得到這個異常:Flyway Ant嘗試打開.sql文件作爲zip,失敗並出現ZipException
Unable to obtain resource from (...)/src/ddl/V1__create_tables_logging.sql: java.util.zip.ZipException: error in opening zip file
[flyway:migrate] Unable to obtain resource from (...)/src/ddl/V1__create_tables_logging.sql:
[flyway:migrate] java.util.zip.ZipException: error in opening zip file
有在最後一個建議:
[flyway:migrate] Possible solution: run the Ant javac and copy tasks first so Flyway can find the migrations
但我的項目不是一個Java應用程序,我沒有任何Java源代碼用javac編譯。 Flyway是否需要將遷移腳本包裝在jar中?難道它只是用SQL語句運行一些文本文件嗎?
該文檔具有誤導性,它表示遷移應該在類路徑中,但只有在您事先將它們編譯爲jars時纔有效。作爲我的工作是使用flyway.locations屬性,並在文件顯示的示例之一中預先加上「filesystem:」路徑。 – lukfi