why maven liquibase:diff -DdiffExcludeObjects parameter does not work

天涯浪子 提交于 2021-01-29 04:20:59

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!