Unable to get liquibase to read changes on my JPA entities

716 views Asked by At

I'm trying to set up liquibase on a spring boot project. I want to set my JPA entities as a reference so that when I run mvn liquibase:diff any changes are written into a changelog. I'm able to run mvn liquibase:generateChangeLog and the file is written and read on application start. However whenever I make some change on one of my entities the diff result is always No changes found, nothing to do.

This is my liquibase.properties

changeLogFile=src/main/resources/db/changelog/changelog-master.yaml
outputChangeLogFile=src/main/resources/db/changes/init.xml
diffChangeLogFile=src/main/resources/db/db.changelog-master.xml
username=postgres
password=postgres
url=jdbc:postgresql://localhost:5432/my_db
driver=org.postgresql.Driver
verbose=true
defaultSchemaName=public
referenceDriver=liquibase.ext.hibernate.database.connection.HibernateDriver
referenceUrl=hibernate:spring:com.domain.api.models\
  ?dialect=org.hibernate.dialect.PostgreSQL82Dialect\
  &hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy\
  &hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy

and my pom.xml

<plugin>
    <groupId>org.liquibase</groupId>
    <artifactId>liquibase-maven-plugin</artifactId>
    <version>4.3.4</version>
    <configuration>
        <propertyFile>./src/main/resources/liquibase.properties</propertyFile>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.liquibase.ext</groupId>
            <artifactId>liquibase-hibernate5</artifactId>
            <version>4.3.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>2.0.1.Final</version>
        </dependency>
    </dependencies>
</plugin>

what am I missing here?

0

There are 0 answers