ali akbar azizkhani
ali akbar azizkhani

Reputation: 2279

why maven liquibase:diff -DdiffExcludeObjects parameter does not work

I have a project that is using liquibase for database sync. When I use maven liquibase for generating a changelog, I want to exclude some database objects whose names start with oauth_

My maven goal is like this

liquibase:diff -DdiffExcludeObjects="table:oauth_.*"

But when I execute the goal, the generated changelog includes these changesets:

<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-4">
    <dropTable tableName="oauth_access_token"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-5">
    <dropTable tableName="oauth_approvals"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-6">
    <dropTable tableName="oauth_client_details"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-7">
    <dropTable tableName="oauth_client_token"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-8">
    <dropTable tableName="oauth_code"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-9">
    <dropTable tableName="oauth_refresh_token"/>
</changeSet>

Upvotes: 2

Views: 2296

Answers (3)

huytmb
huytmb

Reputation: 4274

The correct answer:

mvn liquibase:diff -Dliquibase.diffExcludeObjects="table:oauth_.*"

with -Dliquibase. is Parameter prefix.

More parameter in here

Upvotes: 1

Matti
Matti

Reputation: 35

mvn liquibase:diff -Dliquibase.diffExcludeObjects=oauth_*

Upvotes: 1

SteveDonie
SteveDonie

Reputation: 9016

I think the problem may be just the name of the property. Documentation indicates that the property should be exludeObjects not diffExcludeObjects.

Upvotes: 1

Related Questions