Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Liquibase change log file could not be found

Using gradle-liquibase plugin in our project with all dependencies resolved.

I have the following liquibase task as suggested by Gradle liquibase plugin:

liquibase {
   activities {
   main {      
      changeLogFile 'src/main/resources/db/dbchangelog-master.xml'
      url 'jdbc:mysql://localhost:3306/test'
      username 'XXX'
      password 'XXX'
     } 
  }
 runList = 'main'
}

But encountered problems with the changeLogFile not being identified by liquibase though the logfile is in project classpath directory (src/main/resources/)

Error:

Caused by: liquibase.exception.ChangeLogParseException:
src/main/resources/dbchangelog/db.changelog-master.xml does not exist

Any help with regards to how should I resolve this classpath related issue?

like image 366
FakirTrappedInCode Avatar asked Nov 28 '14 11:11

FakirTrappedInCode


1 Answers

Just add a classpath parameter where your src directory is

liquibase {
   activities {
   main {      
      changeLogFile 'src/main/resources/db/dbchangelog-master.xml'
      url 'jdbc:mysql://localhost:3306/test'
      username 'XXX'
      password 'XXX'
      classpath "$rootDir"
     } 
  }
 runList = 'main'
}
like image 149
Webaib Avatar answered Sep 28 '22 02:09

Webaib