Liquibase在spring项目中找不到要生成差异的实体类

Liquibase在spring项目中找不到要生成差异的实体类,spring,hibernate,database-migration,liquibase,liquibase-hibernate,Spring,Hibernate,Database Migration,Liquibase,Liquibase Hibernate,Liquibase在给定的包中找不到我的实体类(JPA注释)来生成差异 当我使用mvn liquibase:diff命令时,它会显示未发现任何更改,无需执行任何操作,但我的实体有新字段 我使用spring framweork、JPA(hibernate)、Liquibase、Liquibase hibernate 这是我的密码: 液化酶性质 referenceUrl=hibernate:spring:model.entity.persistent?dialect=org.hibernate.di

Liquibase在给定的包中找不到我的实体类(JPA注释)来生成差异

当我使用
mvn liquibase:diff
命令时,它会显示未发现任何更改,无需执行任何操作,但我的实体有新字段

我使用spring framweork、JPA(hibernate)、Liquibase、Liquibase hibernate

这是我的密码:

液化酶性质

referenceUrl=hibernate:spring:model.entity.persistent?dialect=org.hibernate.dialect.OracleDialect
changeLogFile=src/main/resources/liquibase-changeLog.xml
url=jdbc:oracle:thin:@localhost:1521:xe
username=username
password=password
driver=oracle.jdbc.OracleDriver
diffChangeLogFile=src/main/resources/liquibase-diff-changeLog-8.xml
xml liquibase hibernate配置

<plugin>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-maven-plugin</artifactId>
            <version>3.5.3</version>
            <configuration>
                <propertyFile>src/main/resources/liquibase.properties</propertyFile>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>update</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.liquibase.ext</groupId>
                    <artifactId>liquibase-hibernate4</artifactId>
                    <version>3.5</version>
                </dependency>
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-beans</artifactId>
                    <version>4.1.7.RELEASE</version>
                </dependency>
                <dependency>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-jpa</artifactId>
                    <version>1.7.3.RELEASE</version>
                </dependency>


                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-jdbc</artifactId>
                    <version>2.0.6</version>
                </dependency>

                <dependency>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                    <version>1.19</version>
                </dependency>

            </dependencies>
        </plugin>

org.liquibase
liquibase maven插件
3.5.3
src/main/resources/liquibase.properties
更新
org.liquibase.ext
液化酶-4
3.5
org.springframework
春豆
4.1.7.1发布
org.springframework.data
spring数据jpa
1.7.3.1发布
org.springframework
SpringJDBC
2.0.6
org.yaml
毒蛇
1.19

我尝试了以下方法

pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-maven-plugin</artifactId>
            <version>3.5.3</version>
            <configuration>
                <propertyFile>liquibase.properties</propertyFile>
                <changeLogFile>changelogs/db.changelog-master.xml</changeLogFile>
            </configuration>
            <executions>
                <execution>
                    <phase>process-resources</phase>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.liquibase.ext</groupId>
                    <artifactId>liquibase-hibernate5</artifactId>
                    <version>3.6</version>
                </dependency>
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-beans</artifactId>
                    <version>4.1.7.RELEASE</version>
                </dependency>
                <dependency>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-jpa</artifactId>
                    <version>1.7.3.RELEASE</version>
                </dependency>
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-jdbc</artifactId>
                    <version>2.0.6</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>2.2.11</version>
                </dependency>
                <dependency>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                    <version>1.19</version>
                </dependency>
            </dependencies>
        </plugin>

    </plugins>
</build>
它毫无问题地工作了

 [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building liquibase-jpa-update 0.0.1-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] 
    [INFO] --- liquibase-maven-plugin:3.5.3:diff (default-cli) @ liquibase-jpa-update ---
    [INFO] ------------------------------------------------------------------------
    [INFO] Parsing Liquibase Properties File
    [INFO]   File: liquibase.properties
    [INFO]   'outputChangeLogFile' in properties file is not being used by this task.
    [INFO] ------------------------------------------------------------------------
    [INFO] Executing on Database: jdbc:mysql://127.0.0.1:3306/liquibasetest

INFO 05.01.18, 12:58: liquibase-hibernate: Reading hibernate configuration hibernate:spring:ch.karthi.liquibase.jpa.update.entities?dialect=org.hibernate.dialect.MySQL5Dialect
INFO 05.01.18, 12:58: liquibase-hibernate: Found package ch.karthi.liquibase.jpa.update.entities
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
WARNING: An illegal reflective access operation has occurred
WARNING: Please consider reporting this to the maintainers of javassist.util.proxy.SecurityActions
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO 05.01.18, 12:58: liquibase-hibernate: Using dialect org.hibernate.dialect.MySQL5Dialect
[INFO] Performing Diff on database root@localhost @ jdbc:mysql://127.0.0.1:3306/liquibasetest (Default Schema: liquibasetest)
INFO 05.01.18, 12:58: liquibase-hibernate: Found table Customer
INFO 05.01.18, 12:58: liquibase-hibernate: Found table Customer
INFO 05.01.18, 12:58: liquibase-hibernate: Found table Customer
INFO 05.01.18, 12:58: liquibase-hibernate: Found primary key CustomerPK
INFO 05.01.18, 12:58: liquibase-hibernate: Found column id integer
INFO 05.01.18, 12:58: liquibase-hibernate: Found column age integer
INFO 05.01.18, 12:58: liquibase-hibernate: Found column name varchar(255)
INFO 05.01.18, 12:58: liquibase-hibernate: Found column sexString varchar(255)
INFO 05.01.18, 12:58: liquibase: src/main/resources/liquibase-diff-changeLog-8.xml exists, appending
[INFO] Differences written to Change Log File, src/main/resources/liquibase-diff-changeLog-8.xml
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.328 s
[INFO] Finished at: 2018-01-05T12:58:37+01:00
[INFO] Final Memory: 25M/85M
[INFO] ------------------------------------------------------------------------

您是否了解新jpa实体的差异?我的意思是,它正在为createtable创建更改集吗?
 [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building liquibase-jpa-update 0.0.1-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] 
    [INFO] --- liquibase-maven-plugin:3.5.3:diff (default-cli) @ liquibase-jpa-update ---
    [INFO] ------------------------------------------------------------------------
    [INFO] Parsing Liquibase Properties File
    [INFO]   File: liquibase.properties
    [INFO]   'outputChangeLogFile' in properties file is not being used by this task.
    [INFO] ------------------------------------------------------------------------
    [INFO] Executing on Database: jdbc:mysql://127.0.0.1:3306/liquibasetest

INFO 05.01.18, 12:58: liquibase-hibernate: Reading hibernate configuration hibernate:spring:ch.karthi.liquibase.jpa.update.entities?dialect=org.hibernate.dialect.MySQL5Dialect
INFO 05.01.18, 12:58: liquibase-hibernate: Found package ch.karthi.liquibase.jpa.update.entities
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
WARNING: An illegal reflective access operation has occurred
WARNING: Please consider reporting this to the maintainers of javassist.util.proxy.SecurityActions
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO 05.01.18, 12:58: liquibase-hibernate: Using dialect org.hibernate.dialect.MySQL5Dialect
[INFO] Performing Diff on database root@localhost @ jdbc:mysql://127.0.0.1:3306/liquibasetest (Default Schema: liquibasetest)
INFO 05.01.18, 12:58: liquibase-hibernate: Found table Customer
INFO 05.01.18, 12:58: liquibase-hibernate: Found table Customer
INFO 05.01.18, 12:58: liquibase-hibernate: Found table Customer
INFO 05.01.18, 12:58: liquibase-hibernate: Found primary key CustomerPK
INFO 05.01.18, 12:58: liquibase-hibernate: Found column id integer
INFO 05.01.18, 12:58: liquibase-hibernate: Found column age integer
INFO 05.01.18, 12:58: liquibase-hibernate: Found column name varchar(255)
INFO 05.01.18, 12:58: liquibase-hibernate: Found column sexString varchar(255)
INFO 05.01.18, 12:58: liquibase: src/main/resources/liquibase-diff-changeLog-8.xml exists, appending
[INFO] Differences written to Change Log File, src/main/resources/liquibase-diff-changeLog-8.xml
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.328 s
[INFO] Finished at: 2018-01-05T12:58:37+01:00
[INFO] Final Memory: 25M/85M
[INFO] ------------------------------------------------------------------------