使用Jhipster项目无法操作Liquibase校验和-服务器时间-

时间:2019-08-12 09:05:20

标签: jhipster liquibase

我想在Jhipster项目中使用Maven操作基本的liquibase操作。我正在使用nvm 10.16.1和Jhipster 6.2.0。我收到一条消息错误。

我检查了服务器时间错误的预知行是否在我的app-dev中,是的。

url: jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC

这是消息错误:

INFO] Starting Liquibase at lun., 12 août 2019 10:54:40 CEST (version     3.6.3 built at 2019-01-29 11:34:48)
[INFO] Settings
----------------------------
[INFO]     driver: com.mysql.cj.jdbc.Driver
[INFO]     url: jdbc:mysql://localhost:3306/project
[INFO]     username: root
[INFO]     password: *****
[INFO]     use empty password: false
[INFO]     properties file: null
[INFO]     properties file will override? false
[INFO]     prompt on non-local database? true
[INFO]     clear checksums? false
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.394 s
[INFO] Finished at: 2019-08-12T10:54:41+02:00
[INFO] Final Memory: 31M/353M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-    plugin:3.6.3:clearCheckSums (default-cli) on project project: Error setting     up or running Liquibase: liquibase.exception.DatabaseException:     java.sql.SQLException: The server time zone value 'Paris, Madrid (heure     d��t�)' is unrecognized or represents more than one time zone. You must     configure either the server or JDBC driver (via the serverTimezone     configuration property) to use a more specifc time zone value if you want to     utilize time zone support. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]         http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1

尝试2 :将网址放入pom xml

  <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>${liquibase.version}</version>
                <configuration>
                    <changeLogFile>${project.basedir}/src/main/resources/config/liquibase/master.xml</changeLogFile>
                    <diffChangeLogFile>${project.basedir}/src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
                    <driver>com.mysql.cj.jdbc.Driver</driver>
                    <url>jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC</url>
                    <defaultSchemaName>project</defaultSchemaName>
                    <username>root</username>
                    <password>*******</password>
                    <referenceUrl>hibernate:spring:fr.project.domain?dialect=org.hibernate.dialect.MySQL5InnoDBDialect&amp;hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&amp;hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl>
                    <verbose>true</verbose>
                    <logging>debug</logging>
                    <contexts>!test</contexts>
                </configuration>

新错误为:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM 
C:\Users\clari\Documents\project\pom.xml: entity reference name can not 
contain character =' (position: START_TAG seen 
...mysql://localhost:3306/project?useUnicode=true&characterEncoding=... 
@561:101)  @ line 561, column 101
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project  
(C:\Users\clari\Documents\project\pom.xml) has 1 error
[ERROR]     Non-parseable POM 
C:\Users\clari\Documents\project\pom.xml: entity reference name can not contain character =' (position: START_TAG seen ...mysql://localhost:3306/project?useUnicode=true&characterEncoding=... @561:101)  @ line 561, column 101 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, 
please read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] 
http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException

Process finished with exit code 1

能请你帮我吗?

谢谢:)

1 个答案:

答案 0 :(得分:1)

跟踪显示您使用liquibase-maven-plugin执行clearCheckSums目标,application-dev.yml中的JDBC URL仅由Java应用程序读取,而不是由maven liquibase插件读取。

您还必须在liquibase-maven-plugin的pom.xml属性的url中对其进行配置。

警告,&中的<url>字符应编码为XML实体&amp;

 <url>jdbc:mysql://localhost:3306/project?useUnicode=true&amp;characterEncoding=utf8&amp;useSSL=false&amp;useLegacyDatetimeCode=false&amp;serverTimezone=UTC</url>