Running custom extension in Liquibase -element is not bounded

 

Hi,

 

I am trying to write new extension using Liquibase performing the following steps:

1-Download Liquibase core project and configure it using eclipse

2-Create new Java project called custom-Liquibase which is depending on Liquibase core project

3-Create the following hierarchy structure \liquibase-custom\src\liquibase\ext\Vacuum     (Taking this example from liqubase extension) Adding the following files:

                VacuumChange.java

VacuumPostgres.java

                VacuumStatement.java  

4- Create the following hierarchy structure liquibase-custom\src\liquibase\parser\core\xml

                dbchangelog-ext.xsd

                                                                >

"tableName" />

>

 

 5-create new custom jar from my project liquibase-custom.jar

 6-Adding the following change sets to my mail changelog.xml

               

                               

                                

                               

                               

      

 

   

                  

   

 

7-Run Liquibase in the following mode by adding the new liquibase-custom.jar to my classpath:

java -jar liquibase.jar  --driver=org.postgresql.Driver --classpath=lib/postgresql-42.1.4.jar;lib/liquibase-custom.jar --changeLogFile=sdk/workspace/changelog/com/example/changelog.xml --url="jdbc:postgresql://localhost:5432/Demo1" --username=postgres --password=1234 update

 

8-I am getting the error :

                Unexpected error running Liquibase: The prefix "vacuum" for element "vacuum:vacuum" is not bound.

 

 

 

I will be happy to know if I missing something in the above steps, or maybe I am not working properly in the way custom change should be written

 

Thanks

Can you include the xml namespace portions at the top of your changelog.xml and dbchangelog-ext.xsd file? The error you are running into may be due to that format. The vacuum prefix namespace may not be defined.

Also, I ran into a similar issue with running the liquibase jar from command line. --classpath will not pick up your custom jar. Instead do the following pass the jars on the classpath jvm option and only pass in your db driver jar on --classpath. Similar to below: 

–changeLogFile=sdk/workspace/changelog/com/example/changelog.xml --url=“jdbc:postgresql://localhost:5432/Demo1” --username=postgres --password=1234 update