0
發佈這個自我回答,所以當我在幾個月內再次打破時,答案會實際上在谷歌出現。Proguard休息Flyway數據庫遷移
Flyway API用於遷移數據庫模式的簡單Java項目。遵循V1__init.sql,V2__updateCustomerTable.sql約定的sql腳本資源目錄用於檢查schema_version元數據表並根據需要進行遷移。
一切工作正常,直到jar被編程。 SQL腳本肯定是打包成jar文件,但他們都沒有找到:
2017-04-10 17:17:13,612 [main] DEBUG (?:?) - Validating migrations ...
2017-04-10 17:17:13,884 [main] DEBUG (?:?) - Scanning for classpath resources at 'classpath:db/migration/postgres' (Prefix: '', Suffix: '.sql')
2017-04-10 17:17:13,885 [main] DEBUG (?:?) - Determining location urls for classpath:db/migration/postgres using ClassLoader [email protected] ...
2017-04-10 17:17:13,885 [main] WARN (?:?) - Unable to resolve location classpath:db/migration/postgres
2017-04-10 17:17:13,899 [main] DEBUG (?:?) - Scanning for classpath resources at 'classpath:db/migration/postgres' (Prefix: 'V', Suffix: '.sql')
2017-04-10 17:17:13,900 [main] DEBUG (?:?) - Scanning for classpath resources at 'classpath:db/migration/postgres' (Prefix: 'R', Suffix: '.sql')
一個沒有proguarded罐子發現他們具有以下日誌消息(請注意,它看起來在jar文件現在):
2017-04-10 17:07:16,612 [main] DEBUG (?:?) - Validating migrations ...
2017-04-10 17:07:16,613 [main] DEBUG (?:?) - Scanning for classpath resources at 'classpath:db/migration/postgres' (Prefix: 'V', Suffix: '.sql')
2017-04-10 17:07:16,614 [main] DEBUG (?:?) - Scanning URL: jar:file:/C:/Dev/Sanbox/myjar.jar!/db/migration/postgres
2017-04-10 17:07:16,614 [main] DEBUG (?:?) - JBoss VFS v2 available: false
2017-04-10 17:07:16,615 [main] DEBUG (?:?) - Filtering out resource: db/migration/postgres/ (filename:)
2017-04-10 17:07:16,615 [main] DEBUG (?:?) - Found resource: db/migration/postgres/V1__init.sql
2017-04-10 17:07:16,616 [main] DEBUG (?:?) - Found resource: db/migration/postgres/V2__updateCustomerTable.sql