liquibase / liquibase-gradle-plugin

A Gradle plugin for Liquibase
Other
200 stars 59 forks source link

DataSource support #19

Closed DasHasan closed 7 years ago

DasHasan commented 7 years ago

Is it possible to use a jndi dataSource instead of Username and Password?

stevesaliman commented 7 years ago

The short answer is that Liquibase itself doesn't have a way to pass in jndi info, so the Liquiabse Gradle plugin can't either. Also, isn't a JNDI lookup something that is normally done inside a container? Aren't Gradle builds normally operating outside a container?

That said, there might be a way to get what you need. Since Gradle script is just Groovy (which can run any Java code), you might be able do the JNDI lookup from within the build script, extract the connection information from it, and then pass that information to Liquibase using the standard url, username, and password arguments.