I’m currently trying to test LiquiBase 2.0 in an existing build environment using ant. I get the following error when my ant target tries to call “updateDatabase”:
$ ant update-databases
Buildfile: build.xml
update-prepare:
[taskdef] Could not load definitions from resource scripts/liquibase/liquibase.properties. It could not be found.
update-databases:
BUILD FAILED
/myapp/scripts/build.xml:33: Problem: failed to create task or type updateDatabase
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
Total time: 0 seconds
It seems to me that the liquibase.jar file is not loaded, but I cant see why.
My build area has the following structure:
/myapp
/scripts
/liquibase
lib/
mysql-connector-java.jar
liquibase.jar
liquibase
db.changelog.xml
I’ve got the following config:
#/myapp/build.xml (top level build.xml)
...
...
#/myapp/scripts/build.xml
basedir param not set. Run from your ant base dir.
database url not set
database.username not set
database.password not set
I’ve tested with the lastest release candidate with the same result. Looks like this is more of a Ant issue than a liquibase issue. It does not seem like Ant successfully loads the liquibase.jar file so that the updateDatabase task is available to Ant.
I’ve also tested putting the liquibase.jar file in ant’s lib (/usr/share/ant/lib) without any success.
Has this issue been resolved. I am using the latest stable version of the liquibase jar and still see the issue. I have put the liquibase jar in ANT/lib. I still get the same error.
It works fine for me in ant. I don’t add liquibase.jar to the ant/lib folder but instead use the classpathref attribute on taskdef to point to a classpath containing liquibase.
I also use the same classpath with liquibase and my jdbcdriver in the classpathref attribute of the task, although I’m not sure if that is needed or not.