Comments (2)
The short answer for this request is to put liquibaseTaskPrefix=abc
in your project's gradle.properties
file. Doing this will meet your goal of not having to put it on the command line.
There is no good way use the liquibase
configuration to change how the Liquibase tasks get created. Unless you're really interested in the technical details, you can probably stop reading here 😃
The long answer as to why there is no good way to do this has to do with order that Gradle does things, which looks like this:
- Gradle applies the plugin when it sees
apply plugin
or aplugins
block inbuild.gradle
- The liquibase plugin creates the
liquibase
configuration and adds all the tasks when the plugin is applied. - Gradle processes the
liquibase
configuration when it reaches it in thebuild.gradle
file. - Gradle runs requested tasks, with the right configuration.
This ordering causes some limitations for us with regard to defining task prefixes in the configuration.
- We can't put the
liquibase
block above theapply plugin
code inbuild.gradle
because the configuration does not exist until the plugin is applied. - The plugin does currently create tasks before it creates the
liquibase
configuration, but we can't just switch the order because defining the configuration and processing it happen at different times. - We might be able to do something weird like deferring the task creation until the
liquibase
configuration is processed, but this is counter to the convention of creating tasks when the plugin is applied, and would lead to some rather unexpected results if anyone ever tried to use the tasks in dependencies. - We might also be able to rename tasks when we process the
liquibase
configuration, but that would create all of the same problems as above.
The bottom line is that tasks get created before configurations are processed. A configuration is designed to affect how a plugin runs, not how the plugin is applied. This limitation is what led me to use Gradle properties to define the prefix task prefix. Properties will always exist before the plugin gets applied, and putting them in gradle.properties
is just as good as having them in a configuration if you're looking for a permanent prefix for all users.
from liquibase-gradle-plugin.
That's not exactly the best answer for someone looking to wrap this plugin with their own specific needs, this is unfortunate, because I wanted to handle the setting of this property in my plugin, not with a specific, random property I need to add to every project that uses my plugin.
from liquibase-gradle-plugin.
Related Issues (20)
- Problem with using the Liquibase block in build.gradle HOT 1
- Problem with labelFilter argument HOT 1
- Avoiding duplication of properties between spring boot and gradle HOT 1
- With Gradle 7.6.2 and Java 17, Liquibase build throwing 'org.liquibase.gradle.LiquibaseTask' property 'command' is missing an input or output annotation HOT 3
- Is this project still active? HOT 2
- Is there a simple way to disable the plugin? HOT 2
- liquibase-gradle-plugin should declare picocli as a transitive dependency HOT 9
- Generate Changelog with defaultSchemaName not possible HOT 1
- Running Liquibase 4 with Gradle 8 causes error could not find method getMain() for arguments [] HOT 2
- spring boot v3 integration example HOT 5
- micronaut 4 liquibase plugin integration
- Liquibase --username argument should be placed after the command
- Task "updateSQL" ignores "--outputFile" parameter HOT 3
- Upgrade to "org.apache.groovy:groovy" HOT 1
- Java 19
- Liquibase "diffChangelog" suddenly stops generating migration files HOT 2
- markNextChangesetRan not filtering by label HOT 1
- Snakeyaml error when running diffChangelog
- Modify Liquibase Gradle Plugin to handle custom Liquibase extensions HOT 4
- Crashes with 2 errors when configuration cache is enabled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquibase-gradle-plugin.