无法操作 liquibase 校验和 - 服务器时间 - 与 Jhipster 项目



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

我检查了服务器时间错误的预识别行是否在我的应用程序开发中,是的。

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

TRY 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:UsersclariDocumentsprojectpom.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:UsersclariDocumentsprojectpom.xml) has 1 error
[ERROR]     Non-parseable POM 
C:UsersclariDocumentsprojectpom.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

你能帮帮我吗?

谢谢:)

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

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

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

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

最新更新