Calling liquibase from java

I saw that there are several ways of using liquibase (maven, servlet, command line etc…) but I doesn’t mention API call from java application.
Is it possible or not recommended ?
I would like to do this in order to change by program liquibase parameters like contexts and files.

I just found similar question and answer :
Is this officially supported ?

I have been using Liquibase straight from Izpack actions and the use case is very similar to how the Liquibase commandline uses the API.  So as long as you use it in a similar fashion to how Liquibase does your code should be relatively safe.

When i did this i didn’t have the time to study the “internal” APIs and just called the main method using the standard command line parameters. I am not really happy with that and want to change that sooner or later is that is a bit fishy. There is no reason why it shouldn’t work unless Liquibase changes the command line parameters. But i would suggest to use a cleaner solution.

Yes, it is perfectly fine to call liquibase from a java application.  Before 2.0 we did not have our object interfaces officially supported, but with 2.0 onward they will be stable.  Integration and extension is the primary goal of the upcoming 2.0 release.