Maven-liquibase-plugin: diff does not recognize changes

Hello everyone!

I am trying to get a changelog by diff-ing my JPA entities agains a not-up-to-date database. You can check this project. I am using the hibernate:ejb3 mode. This is the command I run:

mvn liquibase:diff -Dliquibase.diffChangeLogFile=/tmp/databasechangelog.txt -DPG_HOST=localhost -DPG_PORT=5432 -DPG_DATABASE=postgres -DPG_USER=postgres -DPG_PASSWORD=password

Output says entities were found, old ones and those early added to my code (so not registered in the database), but

....
[INFO] No changes found, nothing to do
[INFO] Differences written to Change Log File, /tmp/databasechangelog.txt
....

What am I doing wrong? Thankyou!

@fpezzati ,

Could you please provide reproducible steps? Sorry, I am not able to readily determine how to take your git repo project to the point of reproducing this error.

Thanks,

Ronak

Hello Ronak,
I see you found my SO post where I ask for help for first. I read your answer, problems were two:

  • I was using diff goal but expecting diffChangelog behavior,
  • I was using the wrong param to tell diff where to store the output.

So thankyou. Now I am trying to obtain a diffChangelog by comparing a database agains my hibernate/jpa project, I want to use Liquibase as an alternative to hbm2ddl. I see there is no goal to achieve this, I’ll use liquibase without maven. But this is another question, see you my next question :slight_smile: thankyou again