I started writing some extensions for LiquiBase and want to share my knowledge on this, because the documentation is …
This example shows how to write an extension for LiquiBase that introduces the new “helloWorld” tag for changelogs.
At first you have to extend the changelog schema. Create a new schema changelog-ext.xsd in the package liquibase.parser.core.xml. The LiquiBase schema resolver is watching for schemas in this package.
Thanks for the write-up. I am planning on improving the documentation, just working on finalizing the code first…
Whenever you find areas that could be improved, feel free to update the site as well. It is running as a wiki to allow anyone to add to the docs as needed.
so I did all the above documented steps… but I keep getting the following exception:
org.xml.sax.SAXException: Unknown Liquibase extension: dropAllProcedures. Are you missing a jar from your classpath?
at liquibase.parser.core.xml.XMLChangeLogSAXHandler.startElement(XMLChangeLogSAXHandler.java:332)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:220)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:739)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:322)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:98)
at liquibase.Liquibase.update(Liquibase.java:106)
at liquibase.Liquibase.update(Liquibase.java:144)
at liquibase.integration.commandline.Main.doMigration(Main.java:700)
at liquibase.integration.commandline.Main.main(Main.java:115)
That makes it sound like either your custom class is not being found by the classloader running liquibase, or else your custom class is not passing “dropAllProcedures” as the first parameter to the superclass’s constructor. It will not be found by the classloader if it is not in one of the packages (or it’s subpackages) listed in the MANIFEST.MF file:
That is odd. Could you attach the extension jar file you have and how you are tryign to run it? If you’d prefer, you can email it to me at nathan@liquibase.org
I tried the steps to create my own mssql extension, but got error “Invalid content was found…” for elements I defined in dbchangelog-ext.xsd.
The version of Liquibase I downloaded is 3.0.0-beta2-snapshot. I have replaced dbchangelog-ext.xsd in liquibase-core\src\main\resources\liquibase\parser\core\xml and placed a copy of dbchangelog-ext.xsd in the folder where the extension jar file is located and rebuilt liquibase and extension jars, but I still got the error.