开发者

sqlFile refactoring in liquibase can't find file on the classpath

开发者 https://www.devze.com 2023-04-09 11:01 出处:网络
The documentation for the <sqlFile> custom refactoring tag says that the classpath will be searched for the file.

The documentation for the <sqlFile> custom refactoring tag says that the classpath will be searched for the file. However I cannot get it to find my file, despite it being in the classpath.

The changeset element is:

<changeSet author="rebecca" id="9.1 - LoanIQ GoLive">
 <comment>No rollback script exists</comment>
 <sqlFile path="v9.1-loaniqgolive.sql"/>
</changeSet>

The ant task is:

<updateDatabase
    changeLogFile="@{changelog}"
    driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
    url="jdbc:sqlserver://${database.host}:${database.port};databaseName=${database.name}"
    username="${database.user}"
    password="${database.password}"
    promptOnNonLocalDatabase="false"
    dropFirst="false"
    classpathref="liquibase.path"/>

The build reports that the liquibase path is:

[echo] The liquibase path = D:\Program Files\Jenkins\jobs\Deploy GMM\workspace\app\build\database;D:\Program Files\J开发者_运维技巧enkins\jobs\Deploy GMM\workspace\app\build\tools\liquibase\liquibase.jar;D:\Program Files\Jenkins\jobs\Deploy GMM\workspace\app\build\lib\sqljdbc.jar

I have confirmed that v9.1-loaniqgolive.sql is definitely in the path (1st element).

Yet I get this error:

D:\Program Files\Jenkins\jobs\Deploy GMM\workspace\app\build\ant\functions\db.xml:56: liquibase.exception.ChangeLogParseException: Invalid Migration File: <sqlfile path=v9.1-loaniqgolive.sql> -Unable to read file
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:132)

My config looks OK, but it doesn't work. How can I solve this or debug further?


One quick suggestion I have is to run Ant with -verbose and -debug command line parameters. This puts out a lot of logging but generally helps get you closer to the source of the problem.

I will try to create an equivalent Ant task against one of my dbs and respond with any updates.

0

精彩评论

暂无评论...
验证码 换一张
取 消