La refactorización de sqlFile en liquibase no puede encontrar el archivo en la ruta de clase

La documentación para el <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\Jenkins\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).

Sin embargo, obtengo este 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?

preguntado el 28 de septiembre de 11 a las 05:09

1 Respuestas

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.

Respondido el 29 de Septiembre de 11 a las 07:09

Thanks @mikemil. I tried to recreate the issue today and I couldn't! It worked without any problem. I had suspected spaces in the path. - Synesso

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.