问题
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>
回答1:
I think the problem may be just the name of the property. Documentation indicates that the property should be exludeObjects
not diffExcludeObjects
.
回答2:
mvn liquibase:diff -Dliquibase.diffExcludeObjects=oauth_*
回答3:
The correct answer:
mvn liquibase:diff -Dliquibase.diffExcludeObjects="table:oauth_.*"
with -Dliquibase.
is Parameter prefix.
More parameter in here
来源:https://stackoverflow.com/questions/38706429/why-maven-liquibasediff-ddiffexcludeobjects-parameter-does-not-work