Liquibase .sql file not found

0

When I run liquibase it does not find .slq files configured by the tag. SQLFile. How do you solve this?

Problem data:

  • Use in the project Liquibase 3.4.2.
  • Configure the maven plugin
  • Run script in Maven Ok everything works (Windows + Eclipse + plugin)
  • Execute plugin maven, No Eclise
  • In the production environment I have .war, and I do not have maven.
  • Putting into Production

Since I no longer have maven, I execute the command by the jar of liquibase called liquibase-core-3.4.2 . Run up the changeSet where you have SQLFile files set up as seen below

<changeSet author="aut-01" id="municipios-1"  runInTransaction="true" context="local, test, homolog, production" runOnChange="false">
    <comment> first 3 municipios </comment>
    <sqlFile path="sql/municipios-0-78.sql" endDelimiter=";" relativeToChangelogFile="true" />
    <rollback />
</changeSet>

Error generated

SEVERE  PM: liquibase: WEB-INF/classes/changelogs/versions/1.0.0.0/db.changelog-municipios-br-1.0.0.0.xml::municipios-1::aut-01: 
    File does not exist: 'sql/municipios-0-78.sql'
liquibase.exception.UnexpectedLiquibaseException: java.io.IOException: File does not exist: 'sql/municipios-0-78.sql'
    at liquibase.change.AbstractSQLChange.generateCheckSum(AbstractSQLChange.java:179)
    at liquibase.changelog.ChangeSet.generateCheckSum(ChangeSet.java:251)
    at liquibase.changelog.ChangeSet.toString(ChangeSet.java:770)
    at liquibase.changelog.ChangeLogIterator.createKey(ChangeLogIterator.java:107)
    at liquibase.changelog.ChangeLogIterator.alreadySaw(ChangeLogIterator.java:115)
    at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:78)
    at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:259)
    at liquibase.Liquibase.update(Liquibase.java:210)
    at liquibase.Liquibase.update(Liquibase.java:192)
    at liquibase.integration.commandline.Main.doMigration(Main.java:1130)
    at liquibase.integration.commandline.Main.run(Main.java:188)
    at liquibase.integration.commandline.Main.main(Main.java:103)
Caused by: java.io.IOException: File does not exist: 'sql/municipios-0-78.sql'
    at liquibase.change.core.SQLFileChange.openSqlStream(SQLFileChange.java:112)
    at liquibase.change.AbstractSQLChange.generateCheckSum(AbstractSQLChange.java:166)
... 11 more

File structure (Running on Linux Ubuntu)

...
    - changelogs
        db.changelog-master.xml
        - versions
            - 1.0.0.0
                .
                .
                .
                db.changelog-municipios-br-1.0.0.0.xml
                - sql
                    .
                    .
                    .
                    municipios-0-78.sql

This is a bug, I found an issue in the project Liquibase Jira

    
asked by anonymous 03.11.2016 / 16:48

0 answers