JAVA SpringBoot : when inside a Docker the liquibase plugin runs with errors and does not execute changelogs

huangapple go评论95阅读模式
英文:

JAVA SpringBoot : when inside a Docker the liquibase plugin runs with errors and does not execute changelogs

问题

I know that the same question was already asked but i have no way to ask the user if he solved it and his question is not complete enough to get help from other users

链接

So I will include more info here to try and have this problem solved :

I have a springboot app running fine for several months on docker. I am in the process of adding the spring liquibase plugin to this app. This plugin works correctly on my local computer, but when I run it in the docker, I have the following errors (and the liquibase changelogs are not performed):

One example of the error is below, but about 400 of these appear in the log, one for each jar in the classpath. The example below is the last of those errors, and it refers to "jakarta.validation-api-2.0.2.jar" as the first line shows. However, the issue is not with this particular jar; something must be wrong in my implementation of Liquibase in the docker that runs this app.

  1. 2020-09-01 00:11:11.219 WARN 1 --- [ main] liquibase.resource : Cannot create filesystem for url jar:file:/opt/target/hov2.jar!/BOOT-INF/lib/jakarta.validation-api-2.0.2.jar!/: null
  2. java.nio.file.FileSystemNotFoundException: null
  3. at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(Unknown Source) ~[jdk.zipfs:na]
  4. at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(Unknown Source) ~[jdk.zipfs:na]
  5. at java.base/java.nio.file.Path.of(Unknown Source) ~[na:na]
  6. at java.base/java.nio.file.Paths.get(Unknown Source) ~[na:na]
  7. at liquibase.resource.ClassLoaderResourceAccessor.loadRootPaths(ClassLoaderResourceAccessor.java:63) ~[liquibase-core-4.0.0.jar!/:na]
  8. ... (The log continues)

The pom.xml to see the versions used:

  1. <!-- The content of your pom.xml with dependency versions -->

The liquibase-dev.properties:

  1. <!-- The content of your liquibase-dev.properties -->

The Dockerfile:

  1. <!-- The content of your Dockerfile -->

And the result of the Docker build gives:

  1. <!-- The content of the Docker build log -->

The dev.properties for the Liquibase part:

  1. <!-- The content of your dev.properties related to Liquibase -->

When starting the Docker (with the dev context), everything goes...

英文:

I know that the same question was already asked but i have no way to ask the user if he solved it and his question is not complete enough to get help from other users

https://stackoverflow.com/questions/63386482/warn-cannot-create-filesystem-for-url-jarfile-app-jar-boot-inf-classes-nul

So I will include more info here to try and have this problem solved :

I have a springboot app running fine for several month on docker, I am in process of adding to this app the spring liquibase plugin, this plugin works correctly on my local computer but when I run it in the docker I have the following errors (and the liquibase changelogs are not performed) :

One Exemple of the error is below but about 400 of these appear on the log, one for each jar in the classpath... the exemple below is the last of those errors and it refers to "jakarta.validation-api-2.0.2.jar" as the first line shows, but the issue is not with this particular jar, something must be wrong in my implementation of Liquibase in the docker that runs this app.

  1. 2020-09-01 00:11:11.219 WARN 1 --- [ main] liquibase.resource : Cannot create filesystem for url jar:file:/opt/target/hov2.jar!/BOOT-INF/lib/jakarta.validation-api-2.0.2.jar!/: null
  2. java.nio.file.FileSystemNotFoundException: null
  3. at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(Unknown Source) ~[jdk.zipfs:na]
  4. at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(Unknown Source) ~[jdk.zipfs:na]
  5. at java.base/java.nio.file.Path.of(Unknown Source) ~[na:na]
  6. at java.base/java.nio.file.Paths.get(Unknown Source) ~[na:na]
  7. at liquibase.resource.ClassLoaderResourceAccessor.loadRootPaths(ClassLoaderResourceAccessor.java:63) ~[liquibase-core-4.0.0.jar!/:na]
  8. at liquibase.resource.ClassLoaderResourceAccessor.init(ClassLoaderResourceAccessor.java:47) ~[liquibase-core-4.0.0.jar!/:na]
  9. at liquibase.resource.ClassLoaderResourceAccessor.openStreams(ClassLoaderResourceAccessor.java:94) ~[liquibase-core-4.0.0.jar!/:na]
  10. at liquibase.resource.CompositeResourceAccessor.openStreams(CompositeResourceAccessor.java:33) ~[liquibase-core-4.0.0.jar!/:na]
  11. at liquibase.parser.core.xml.LiquibaseEntityResolver.resolveEntity(LiquibaseEntityResolver.java:40) ~[liquibase-core-4.0.0.jar!/:na]
  12. at java.xml/com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper.resolveEntity(Unknown Source) ~[na:na]
  13. at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) ~[na:na]
  14. at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[na:na]
  15. at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:91) ~[liquibase-core-4.0.0.jar!/:na]
  16. at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15) ~[liquibase-core-4.0.0.jar!/:na]
  17. at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:223) ~[liquibase-core-4.0.0.jar!/:na]
  18. at liquibase.Liquibase$1.run(Liquibase.java:194) ~[liquibase-core-4.0.0.jar!/:na]
  19. at liquibase.Scope.lambda$child$0(Scope.java:159) ~[liquibase-core-4.0.0.jar!/:na]
  20. at liquibase.Scope.child(Scope.java:170) ~[liquibase-core-4.0.0.jar!/:na]
  21. at liquibase.Scope.child(Scope.java:158) ~[liquibase-core-4.0.0.jar!/:na]
  22. at liquibase.Scope.child(Scope.java:137) ~[liquibase-core-4.0.0.jar!/:na]
  23. at liquibase.Liquibase.runInScope(Liquibase.java:1790) ~[liquibase-core-4.0.0.jar!/:na]
  24. at liquibase.Liquibase.update(Liquibase.java:183) ~[liquibase-core-4.0.0.jar!/:na]
  25. at liquibase.Liquibase.update(Liquibase.java:179) ~[liquibase-core-4.0.0.jar!/:na]
  26. at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:322) ~[liquibase-core-4.0.0.jar!/:na]
  27. at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:270) ~[liquibase-core-4.0.0.jar!/:na]
  28. at org.springframework.boot.autoconfigure.liquibase.DataSourceClosingSpringLiquibase.afterPropertiesSet(DataSourceClosingSpringLiquibase.java:46) ~[spring-boot-autoconfigure-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
  29. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:255) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
  30. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:229) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
  31. at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:53) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
  32. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5128) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  33. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  34. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  35. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  36. at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
  37. at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  38. at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:na]
  39. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  40. at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  41. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  42. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  43. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
  44. ......
  45. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
  46. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
  47. at com.vyv.hov2.MinimalApplication.main(MinimalApplication.java:74) ~[classes!/:2]
  48. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
  49. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
  50. at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
  51. at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
  52. at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[hov2.jar:2]
  53. at org.springframework.boot.loader.Launcher.launch(Launcher.java:109) ~[hov2.jar:2]
  54. at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[hov2.jar:2]
  55. at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[hov2.jar:2]

the pom.xml to see the versions used :

  1. &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  2. xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
  3. &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  4. &lt;groupId&gt;xxxx&lt;/groupId&gt;
  5. &lt;artifactId&gt;xxxx&lt;/artifactId&gt;
  6. &lt;packaging&gt;jar&lt;/packaging&gt;
  7. &lt;properties&gt;
  8. &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  9. &lt;maven.compiler.source&gt;11&lt;/maven.compiler.source&gt;
  10. &lt;maven.compiler.target&gt;11&lt;/maven.compiler.target&gt;
  11. &lt;spring-boot.version&gt;2.3.1.RELEASE&lt;/spring-boot.version&gt;
  12. &lt;hibernate.version&gt;5.4.12.Final&lt;/hibernate.version&gt;
  13. &lt;liquibase-core.version&gt;4.0.0&lt;/liquibase-core.version&gt;
  14. &lt;liquibase-maven-plugin.version&gt;4.0.0&lt;/liquibase-maven-plugin.version&gt;
  15. &lt;liquibase-hibernate5.version&gt;4.0.0&lt;/liquibase-hibernate5.version&gt;
  16. &lt;validation-api.version&gt;2.0.1.Final&lt;/validation-api.version&gt;
  17. &lt;javassist.version&gt;3.27.0-GA&lt;/javassist.version&gt;
  18. &lt;jaxb-api.version&gt;2.4.0-b180830.0359&lt;/jaxb-api.version&gt;
  19. &lt;maven.build.timestamp.format&gt;yyyy-MM-dd&#39;T&#39;HH.mm.ss&lt;/maven.build.timestamp.format&gt;
  20. &lt;/properties&gt;
  21. &lt;parent&gt;
  22. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  23. &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
  24. &lt;version&gt;2.3.1.RELEASE&lt;/version&gt;
  25. &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
  26. &lt;/parent&gt;
  27. &lt;dependencies&gt;
  28. &lt;dependency&gt;
  29. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  30. &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
  31. &lt;/dependency&gt;
  32. &lt;dependency&gt;
  33. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  34. &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
  35. &lt;/dependency&gt;
  36. &lt;dependency&gt;
  37. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  38. &lt;artifactId&gt;spring-boot-starter-mail&lt;/artifactId&gt;
  39. &lt;/dependency&gt;
  40. &lt;dependency&gt;
  41. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  42. &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
  43. &lt;scope&gt;runtime&lt;/scope&gt;
  44. &lt;optional&gt;true&lt;/optional&gt;
  45. &lt;/dependency&gt;
  46. &lt;dependency&gt;
  47. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  48. &lt;artifactId&gt;spring-boot-starter-validation&lt;/artifactId&gt;
  49. &lt;scope&gt;provided&lt;/scope&gt;
  50. &lt;/dependency&gt;
  51. &lt;!-- JPA + Postgresql --&gt;
  52. &lt;dependency&gt;
  53. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  54. &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
  55. &lt;/dependency&gt;
  56. &lt;dependency&gt;
  57. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  58. &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
  59. &lt;/dependency&gt;
  60. &lt;dependency&gt;
  61. &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
  62. &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
  63. &lt;scope&gt;runtime&lt;/scope&gt;
  64. &lt;/dependency&gt;
  65. &lt;dependency&gt;
  66. &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
  67. &lt;artifactId&gt;liquibase-core&lt;/artifactId&gt;
  68. &lt;version&gt;4.0.0&lt;/version&gt;
  69. &lt;/dependency&gt;
  70. &lt;dependency&gt;
  71. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  72. &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
  73. &lt;scope&gt;test&lt;/scope&gt;
  74. &lt;exclusions&gt;
  75. &lt;exclusion&gt;
  76. &lt;groupId&gt;org.junit.vintage&lt;/groupId&gt;
  77. &lt;artifactId&gt;junit-vintage-engine&lt;/artifactId&gt;
  78. &lt;/exclusion&gt;
  79. &lt;/exclusions&gt;
  80. &lt;/dependency&gt;
  81. &lt;dependency&gt;
  82. &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
  83. &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
  84. &lt;version&gt;1.0.2.Final&lt;/version&gt;
  85. &lt;/dependency&gt;
  86. &lt;dependency&gt;
  87. &lt;groupId&gt;javax.validation&lt;/groupId&gt;
  88. &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
  89. &lt;version&gt;${validation-api.version}&lt;/version&gt;
  90. &lt;/dependency&gt;
  91. &lt;/dependencies&gt;
  92. &lt;profiles&gt;
  93. &lt;profile&gt;
  94. &lt;id&gt;dev&lt;/id&gt;
  95. &lt;properties&gt;
  96. &lt;activatedProperties&gt;dev&lt;/activatedProperties&gt;
  97. &lt;/properties&gt;
  98. &lt;activation&gt;
  99. &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
  100. &lt;/activation&gt;
  101. &lt;/profile&gt;
  102. &lt;profile&gt;
  103. &lt;id&gt;prod&lt;/id&gt;
  104. &lt;properties&gt;
  105. &lt;activatedProperties&gt;prod&lt;/activatedProperties&gt;
  106. &lt;/properties&gt;
  107. &lt;/profile&gt;
  108. &lt;/profiles&gt;
  109. &lt;build&gt;
  110. &lt;plugins&gt;
  111. &lt;plugin&gt;
  112. &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
  113. &lt;artifactId&gt;liquibase-maven-plugin&lt;/artifactId&gt;
  114. &lt;version&gt;${liquibase-maven-plugin.version}&lt;/version&gt;
  115. &lt;configuration&gt;
  116. &lt;propertyFile&gt;src/main/resources/liquibase-${activatedProperties}.properties&lt;/propertyFile&gt;
  117. &lt;outputChangeLogFile&gt;src/main/resources/db/db.changelog-${activatedProperties}.xml&lt;/outputChangeLogFile&gt;
  118. &lt;changeLogFile&gt;src/main/resources/db/db.changelog-${activatedProperties}.xml&lt;/changeLogFile&gt;
  119. &lt;diffChangeLogFile&gt;src/main/resources/db/changelog/${activatedProperties}/${maven.build.timestamp}_changelog.xml&lt;/diffChangeLogFile&gt;
  120. &lt;diffTypes&gt;tables,columns,indexes,foreignkeys,primarykeys,uniqueconstraints&lt;/diffTypes&gt;
  121. &lt;logging&gt;info&lt;/logging&gt;
  122. &lt;/configuration&gt;
  123. &lt;!-- Liquibase dependencies--&gt;
  124. &lt;dependencies&gt;
  125. &lt;dependency&gt;
  126. &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
  127. &lt;artifactId&gt;liquibase-core&lt;/artifactId&gt;
  128. &lt;version&gt;${liquibase-core.version}&lt;/version&gt;
  129. &lt;/dependency&gt;
  130. &lt;dependency&gt;
  131. &lt;groupId&gt;org.liquibase.ext&lt;/groupId&gt;
  132. &lt;artifactId&gt;liquibase-hibernate5&lt;/artifactId&gt;
  133. &lt;version&gt;${liquibase-hibernate5.version}&lt;/version&gt;
  134. &lt;/dependency&gt;
  135. &lt;dependency&gt;
  136. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  137. &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
  138. &lt;version&gt;${spring-boot.version}&lt;/version&gt;
  139. &lt;/dependency&gt;
  140. &lt;dependency&gt;
  141. &lt;groupId&gt;javax.validation&lt;/groupId&gt;
  142. &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
  143. &lt;version&gt;${validation-api.version}&lt;/version&gt;
  144. &lt;/dependency&gt;
  145. &lt;dependency&gt;
  146. &lt;groupId&gt;org.javassist&lt;/groupId&gt;
  147. &lt;artifactId&gt;javassist&lt;/artifactId&gt;
  148. &lt;version&gt;${javassist.version}&lt;/version&gt;
  149. &lt;/dependency&gt;
  150. &lt;dependency&gt;
  151. &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
  152. &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
  153. &lt;version&gt;${jaxb-api.version}&lt;/version&gt;
  154. &lt;/dependency&gt;
  155. &lt;dependency&gt;
  156. &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
  157. &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
  158. &lt;version&gt;${postgresql.version}&lt;/version&gt;
  159. &lt;/dependency&gt;
  160. &lt;/dependencies&gt;
  161. &lt;/plugin&gt;
  162. &lt;plugin&gt;
  163. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  164. &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
  165. &lt;version&gt;${spring-boot.version}&lt;/version&gt;
  166. &lt;executions&gt;
  167. &lt;execution&gt;
  168. &lt;goals&gt;
  169. &lt;goal&gt;repackage&lt;/goal&gt;
  170. &lt;/goals&gt;
  171. &lt;/execution&gt;
  172. &lt;/executions&gt;
  173. &lt;/plugin&gt;
  174. &lt;plugin&gt;
  175. &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
  176. &lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
  177. &lt;version&gt;3.12.0&lt;/version&gt;
  178. &lt;executions&gt;
  179. &lt;execution&gt;
  180. &lt;id&gt;pmd-scan&lt;/id&gt;
  181. &lt;phase&gt;verify&lt;/phase&gt;
  182. &lt;goals&gt;
  183. &lt;goal&gt;check&lt;/goal&gt;
  184. &lt;/goals&gt;
  185. &lt;/execution&gt;
  186. &lt;/executions&gt;
  187. &lt;/plugin&gt;
  188. &lt;/plugins&gt;
  189. &lt;/build&gt;
  190. &lt;/project&gt;

the liquibase-dev.properties :

  1. url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
  2. username=xxxx
  3. password=xxxx
  4. driver=org.postgresql.Driver
  5. #### Reference database properties
  6. referenceUrl=hibernate:spring:com.vyv.hov2.domain?dialect=org.hibernate.dialect.PostgreSQLDialect
  7. referenceDriver=liquibase.ext.hibernate.database.connection.HibernateDriver
  8. referenceDefaultSchemaName=db
  9. verbose=true

the dockerfile :

  1. FROM maven:3.6.3-openjdk-11-slim as BUILD
  2. WORKDIR /usr/src/app
  3. COPY checkstyle.xml .
  4. COPY checkstyle-supressions.xml .
  5. COPY licenseheader.txt .
  6. COPY pom.xml .
  7. RUN mvn dependency:go-offline
  8. COPY src src
  9. COPY .git ./.git/
  10. RUN mvn -B -e -C -T 1C package -Dmaven.test.skip=true
  11. FROM openjdk:11.0.8-jre
  12. EXPOSE 8081
  13. COPY --from=BUILD /usr/src/app/target/*.jar /opt/target/hov2.jar
  14. WORKDIR /opt/target
  15. ENV TZ=&quot;America/Bogota&quot;
  16. ENV SPRING_PROFILES_ACTIVE=&quot;dev&quot;
  17. ENV APP_HTTP_THREADS=&quot;4&quot;
  18. ENV DB_MAX_POOL=&quot;4&quot;
  19. ENV DB_CONN_TIMEOUT=&quot;20000&quot;
  20. ENV DB_HOST=&quot;192.168.x.x&quot;
  21. ENV DB_PORT=&quot;xxxx&quot;
  22. ENV DB_NAME=&quot;yyyy&quot;
  23. ENV DB_USER=&quot;zzzz&quot;
  24. ENV DB_PASSWORD=&quot;zzzz&quot;
  25. RUN apt-get -y update &amp;&amp; apt-get -y install apt-utils tzdata &amp;&amp; apt-get -y clean
  26. ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar hov2.jar $JAR_OPTS

and the result of the docker build gives :

  1. D:\GitLab\hov2-springboot&gt;docker build -t xxxx/hov:spring .
  2. Sending build context to Docker daemon 69.29MB
  3. Step 1/27 : FROM maven:3.6.3-openjdk-11-slim as BUILD
  4. ---&gt; 5f736c971204
  5. Step 2/27 : MAINTAINER xxxxx
  6. ---&gt; Using cache
  7. ---&gt; 58e7bae3a780
  8. Step 3/27 : WORKDIR /usr/src/app
  9. ---&gt; Using cache
  10. ---&gt; b790cb47ac8e
  11. Step 4/27 : COPY checkstyle-GlobalRemises.xml .
  12. ---&gt; Using cache
  13. ---&gt; 105a291c538e
  14. Step 5/27 : COPY checkstyle-supressions.xml .
  15. ---&gt; Using cache
  16. ---&gt; 59f933795b44
  17. Step 6/27 : COPY licenseheader.txt .
  18. ---&gt; Using cache
  19. ---&gt; 227d608636c9
  20. Step 7/27 : COPY pom.xml .
  21. ---&gt; Using cache
  22. ---&gt; 3de8cfcf50ce
  23. Step 8/27 : RUN mvn -B dependency:resolve dependency:resolve-plugins
  24. ---&gt; Using cache
  25. ---&gt; 4505edb08bc0
  26. Step 9/27 : COPY src src
  27. ---&gt; 5580f85e37b0
  28. Step 10/27 : COPY .git ./.git/
  29. ---&gt; 9ffa9fdd1d6b
  30. Step 11/27 : RUN mvn -B -e -C -T 1C package -Dmaven.test.skip=true
  31. ---&gt; Running in db75577e3260
  32. [INFO] Error stacktraces are turned on.
  33. [INFO] Scanning for projects...
  34. [INFO]
  35. [INFO] Using the MultiThreadedBuilder implementation with a thread count of 8
  36. [INFO]
  37. [INFO] --------------------&lt; com.vyv.hov2:HOV2-SpringBoot &gt;--------------------
  38. [INFO] Building HerramientaOperativa 2
  39. [INFO] --------------------------------[ jar ]---------------------------------
  40. [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ HOV2-SpringBoot ---
  41. [INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources.
  42. [INFO] Copying 3 resources
  43. [INFO] Copying 994 resources
  44. [INFO]
  45. [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ HOV2-SpringBoot ---
  46. [INFO] Changes detected - recompiling the module!
  47. [INFO] Compiling 536 source files to /usr/src/app/target/classes
  48. [INFO] --- jacoco-maven-plugin:0.8.4:report (report) @ HOV2-SpringBoot ---
  49. [INFO] Skipping JaCoCo execution due to missing execution data file.
  50. [INFO]
  51. [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ HOV2-SpringBoot ---
  52. [INFO] Building jar: /usr/src/app/target/HOV2-SpringBoot-2.jar
  53. [INFO]
  54. [INFO] --- spring-boot-maven-plugin:2.3.1.RELEASE:repackage (repackage) @ HOV2-SpringBoot ---
  55. [INFO] Replacing main artifact with repackaged archive
  56. [INFO]
  57. [INFO] --- spring-boot-maven-plugin:2.3.1.RELEASE:repackage (default) @ HOV2-SpringBoot ---
  58. [INFO] Replacing main artifact with repackaged archive
  59. [INFO] ------------------------------------------------------------------------
  60. [INFO] BUILD SUCCESS
  61. [INFO] ------------------------------------------------------------------------
  62. [INFO] Total time: 20.784 s (Wall Clock)
  63. [INFO] Finished at: 2020-09-01T05:07:54Z
  64. [INFO] ------------------------------------------------------------------------
  65. Removing intermediate container db75577e3260
  66. ---&gt; 419a981baa13
  67. Step 12/27 : FROM openjdk:11.0.8-jre
  68. ---&gt; 9cbf6d4bac44
  69. Step 13/27 : EXPOSE 8081
  70. ---&gt; Using cache
  71. ---&gt; 48eec46f876c
  72. Step 14/27 : COPY --from=BUILD /usr/src/app/target/*.jar /opt/target/hov2.jar
  73. ---&gt; 13d80ab4c8a9
  74. Step 15/27 : WORKDIR /opt/target
  75. ---&gt; Running in f87f4fa28359
  76. Removing intermediate container f87f4fa28359
  77. ---&gt; c00e6df5a4a3
  78. Step 16/27 : ENV TZ=&quot;America/Bogota&quot;
  79. ---&gt; Running in 09d317dc80d3
  80. Removing intermediate container 09d317dc80d3
  81. ---&gt; 57e64896eb41
  82. Step 17/27 : ENV SPRING_PROFILES_ACTIVE=&quot;&quot;
  83. Step 26/27 : RUN apt-get -y update &amp;&amp; apt-get -y install apt-utils tzdata &amp;&amp; apt-get -y clean
  84. ---&gt; Running in 180a8975bfa8
  85. Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
  86. Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
  87. Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
  88. Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [224 kB]
  89. Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7906 kB]
  90. Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [7868 B]
  91. Fetched 8378 kB in 4s (2176 kB/s)
  92. Reading package lists...
  93. Reading package lists...
  94. Building dependency tree...
  95. Reading state information...
  96. tzdata is already the newest version (2020a-0+deb10u1).
  97. tzdata set to manually installed.
  98. The following NEW packages will be installed:
  99. apt-utils libapt-inst2.0
  100. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  101. Need to get 624 kB of archives.
  102. After this operation, 1650 kB of additional disk space will be used.
  103. Get:1 http://deb.debian.org/debian buster/main amd64 libapt-inst2.0 amd64 1.8.2.1 [203 kB]
  104. Get:2 http://deb.debian.org/debian buster/main amd64 apt-utils amd64 1.8.2.1 [421 kB]
  105. debconf: delaying package configuration, since apt-utils is not installed
  106. Fetched 624 kB in 1s (796 kB/s)
  107. Selecting previously unselected package libapt-inst2.0:amd64.
  108. (Reading database ... 7867 files and directories currently installed.)
  109. Preparing to unpack .../libapt-inst2.0_1.8.2.1_amd64.deb ...
  110. Unpacking libapt-inst2.0:amd64 (1.8.2.1) ...
  111. Selecting previously unselected package apt-utils.
  112. Preparing to unpack .../apt-utils_1.8.2.1_amd64.deb ...
  113. Unpacking apt-utils (1.8.2.1) ...
  114. Setting up libapt-inst2.0:amd64 (1.8.2.1) ...
  115. Setting up apt-utils (1.8.2.1) ...
  116. Processing triggers for libc-bin (2.28-10) ...
  117. Removing intermediate container 180a8975bfa8
  118. ---&gt; 6b67dd296d7e
  119. Step 27/27 : ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar hov2.jar $JAR_OPTS
  120. ---&gt; Running in d8740b5c5e53
  121. Removing intermediate container d8740b5c5e53
  122. ---&gt; ca68efe70b02
  123. Successfully built ca68efe70b02
  124. Successfully tagged xxxx/hov:spring
  125. SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have &#39;-rwxr-xr-x&#39; permissions. It
  126. is recommended to double check and reset permissions for sensitive files and directories.

the dev.properties for the liquibase part

  1. # ************* liquibase for DEV
  2. spring.liquibase.enabled=true
  3. spring.liquibase.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
  4. # Change log configuration path.
  5. spring.liquibase.change-Log=classpath:/db/db.changelog-dev.xml
  6. #spring.liquibase.contexts= # Comma-separated list of runtime contexts to use.
  7. # Name of table to use for tracking concurrent Liquibase usage.
  8. spring.liquibase.database-change-log-lock-table=DATABASECHANGELOGLOCK
  9. # Name of table to use for tracking change history.
  10. spring.liquibase.database-change-log-table=DATABASECHANGELOG
  11. #spring.liquibase.default-schema=
  12. # Whether to first drop the database schema.
  13. spring.liquibase.drop-first=false
  14. spring.liquibase.password=xxxx
  15. spring.liquibase.user=xxxx

when starting the docker ( with the dev context) all goes fine untill liquibase pluggin starts,then thousands of error lines (one error for each Jar present in the classpath), then after those errors the app starts fine, the only issue is that the liquibase changlogs are, of course, not executed and therefore the plugin looses most of its utility...

here is the startup log witout the errors in case something usefull is here :

  1. . ____ _ __ _ _
  2. /\\ / ___&#39;_ __ _ _(_)_ __ __ _ \ \ \ \
  3. ( ( )\___ | &#39;_ | &#39;_| | &#39;_ \/ _` | \ \ \ \
  4. \\/ ___)| |_)| | | | | || (_| | ) ) ) )
  5. &#39; |____| .__|_| |_|_| |_\__, | / / / /
  6. =========|_|==============|___/=/_/_/_/
  7. :: Spring Boot :: (v2.3.1.RELEASE)
  8. 2020-09-01 00:11:02.477 INFO 1 --- [ main] com.vyv.hov2.MinimalApplication : Starting MinimalApplication v2 on c795be63b326 with PID 1 (/opt/target/hov2.jar started by root in /opt/target)
  9. 2020-09-01 00:11:02.484 INFO 1 --- [ main] com.vyv.hov2.MinimalApplication : The following profiles are active: dev
  10. 2020-09-01 00:11:05.413 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
  11. 2020-09-01 00:11:06.555 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 1120ms. Found 92 JPA repository interfaces.
  12. 2020-09-01 00:11:08.286 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean &#39;org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@2f40a43&#39; of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  13. 2020-09-01 00:11:08.298 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean &#39;methodSecurityMetadataSource&#39; of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  14. 2020-09-01 00:11:08.993 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (https)
  15. 2020-09-01 00:11:09.013 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
  16. 2020-09-01 00:11:09.013 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.36]
  17. 2020-09-01 00:11:09.136 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
  18. 2020-09-01 00:11:09.137 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6415 ms
  19. 2020-09-01 00:11:09.465 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
  20. 2020-09-01 00:11:09.722 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
  21. 2020-09-01 00:11:10.384 INFO 1 --- [ main] liquibase.lockservice : Successfully acquired change log lock
  22. 2020-09-01 00:11:10.435 WARN 1 --- [ main] liquibase.integration : Cannot create filesystem for url jar:file:/opt/target/hov2.jar!/BOOT-INF/classes!/: null
  23. java.nio.file.FileSystemNotFoundException: null
  24. Here come the hundreds of error ... then the rest is normal again:
  25. 2020-09-01 00:11:11.871 INFO 1 --- [ main] liquibase.changelog : Reading from public.databasechangelog
  26. 2020-09-01 00:11:11.925 INFO 1 --- [ main] liquibase.lockservice : Successfully released change log lock
  27. 2020-09-01 00:11:11.935 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
  28. 2020-09-01 00:11:11.946 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
  29. 2020-09-01 00:11:12.096 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Starting...
  30. 2020-09-01 00:11:12.134 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Start completed.
  31. 2020-09-01 00:11:12.312 INFO 1 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
  32. 2020-09-01 00:11:12.467 INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.12.Final

What did I do wrong ?
One of my ideas was that the path to the db-changelog-dev.xml indicated in the pom.xml would not be the same on my computer and in the docker, but this path is relative to the src folder, so I don't see how to change it...
I had this idea because in the log of the springboot startup we can see liquibase getting the locks on the database changlog tables, but nowhere can be seen the opening of the db-changelog-dev.xml by liquibase, and the errors are relative to filesystem errors, so it seemed conencted to me, but i did not managed to solve it.
Thanks for any idea that could put me on the right track.

thanks @shrom, the first liquibase method that throws the exception has the following javadocs :

  1. /**
  2. * The classloader search logic in {@link #list(String, String, boolean, boolean, boolean)} does not handle jar files well.
  3. * This method is called by that method to populate {@link #rootPaths} with additional paths to search.
  4. */

I like the "does not handle jar files well" ! thats an understatement.
it looks like those WARNINGS are not at the origin of the issue I have with liquibase plugin not performing the DB updates. I must have another issue somewhere else, because based on the other post referenced above the other user had those errors but the DB was updated. and furthermore they are just warning not real errors... I will keep digging.

答案1

得分: 1

找到的原因:

为了摆脱这些错误,我不得不深度更改我的 pom.xml 文件。我删除了属性部分中所有已在引用的 springboot 父级(具体在 spring-boot-dependencies-2.3.1.RELEASE.pom 文件中)中具有值的硬编码版本号,并改为使用此文件的属性。因此,一些生成的版本较低,但我更相信 Spring 而不是我自己来指示插件的正确兼容版本。生成的 POM 如下:

  1. <properties>
  2. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  3. <maven.compiler.source>11</maven.compiler.source>
  4. <maven.compiler.target>11</maven.compiler.target>
  5. <java.version>11</java.version>
  6. <liquibase-hibernate5.version>3.10.1</liquibase-hibernate5.version>
  7. <javassist.version>3.27.0-GA</javassist.version>
  8. <maven.build.timestamp.format>yyyy-MM-dd'T'HH.mm.ss</maven.build.timestamp.format>
  9. </properties>
  10. <parent>
  11. <groupId>org.springframework.boot</groupId>
  12. <artifactId>spring-boot-starter-parent</artifactId>
  13. <version>2.3.1.RELEASE</version>
  14. <relativePath /> <!-- lookup parent from repository -->
  15. </parent>
  16. <dependency>
  17. <groupId>org.springframework.boot</groupId>
  18. <artifactId>spring-boot-starter-web</artifactId>
  19. </dependency>
  20. <dependency>
  21. <groupId>org.springframework.boot</groupId>
  22. <artifactId>spring-boot-starter-data-jpa</artifactId>
  23. </dependency>
  24. <dependency>
  25. <groupId>org.springframework.boot</groupId>
  26. <artifactId>spring-boot-starter-jdbc</artifactId>
  27. </dependency>
  28. <dependency>
  29. <groupId>org.postgresql</groupId>
  30. <artifactId>postgresql</artifactId>
  31. <scope>runtime</scope>
  32. </dependency>
  33. <dependency>
  34. <groupId>org.liquibase</groupId>
  35. <artifactId>liquibase-core</artifactId>
  36. </dependency>
  37. ...
  38. <build>
  39. <plugins>
  40. <plugin>
  41. <groupId>org.liquibase</groupId>
  42. <artifactId>liquibase-maven-plugin</artifactId>
  43. <version>${liquibase.version}</version>
  44. <configuration>
  45. <propertyFile>src/main/resources/liquibase-${activatedProperties}.properties</propertyFile>
  46. <outputChangeLogFile>src/main/resources/db/db.changelog-${activatedProperties}.xml</outputChangeLogFile>
  47. <changeLogFile>src/main/resources/db/db.changelog-${activatedProperties}.xml</changeLogFile>
  48. <diffChangeLogFile>src/main/resources/db/changelog/${activatedProperties}/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
  49. <diffTypes>tables,columns,indexes,foreignkeys,primarykeys,uniqueconstraints</diffTypes>
  50. <!-- diffTypes=tables, views, columns, indexes, foreignkeys, primarykeys, uniqueconstraints, data -->
  51. <logging>info</logging>
  52. </configuration>
  53. <!-- Liquibase dependencies-->
  54. <dependencies>
  55. <dependency>
  56. <groupId>org.liquibase</groupId>
  57. <artifactId>liquibase-core</artifactId>
  58. <version>${liquibase.version}</version>
  59. </dependency>
  60. <dependency>
  61. <groupId>org.liquibase.ext</groupId>
  62. <artifactId>liquibase-hibernate5</artifactId>
  63. <version>${liquibase-hibernate5.version}</version>
  64. </dependency>
  65. <dependency>
  66. <groupId>org.springframework.boot</groupId>
  67. <artifactId>spring-boot-starter-data-jpa</artifactId>
  68. <version>${spring-boot.version}</version>
  69. </dependency>
  70. <dependency>
  71. <groupId>javax.validation</groupId>
  72. <artifactId>validation-api</artifactId>
  73. <version>${javax-validation.version}</version>
  74. </dependency>
  75. <dependency>
  76. <groupId>org.javassist</groupId>
  77. <artifactId>javassist</artifactId>
  78. <version>${javassist.version}</version>
  79. </dependency>
  80. <dependency>
  81. <groupId>javax.xml.bind</groupId>
  82. <artifactId>jaxb-api</artifactId>
  83. <version>${javax-jaxb.version}</version>
  84. </dependency>
  85. <dependency>
  86. <groupId>org.postgresql</groupId>
  87. <artifactId>postgresql</artifactId>
  88. <version>${postgresql.version}</version>
  89. </dependency>
  90. </dependencies>
  91. </plugin>
  92. <plugin>
  93. ...
  94. </build>

在这个 pom 文件的插件部分,你会看到版本号属性,这些值都继承自 SpringBoot 的 pom 文件,不再硬编码在我的 pom 文件中。

现在在 Docker 中正常运行!如果你遇到相同的问题,而我的答案不能帮助你解决它,请留下评论,我会添加我也进行的其他更改,但目前我怀疑它们是否产生了任何影响。

英文:

Reason found :

In order to get rid of those errors I had to deeply change my pom.xml.
I removed all the hardcoded version numbers in the properties section that already have a value in the referenced springboot parent ( specifically in the spring-boot-dependencies-2.3.1.RELEASE.pom ) and instead I used the properties of this file. As a result some of the resulting versions are lower, but I trust more spring than myself to indicate the right compatible version of the plugins. The resulting POM is as follows :

  1. &lt;properties&gt;
  2. &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  3. &lt;maven.compiler.source&gt;11&lt;/maven.compiler.source&gt;
  4. &lt;maven.compiler.target&gt;11&lt;/maven.compiler.target&gt;
  5. &lt;java.version&gt;11&lt;/java.version&gt;
  6. &lt;liquibase-hibernate5.version&gt;3.10.1&lt;/liquibase-hibernate5.version&gt;
  7. &lt;javassist.version&gt;3.27.0-GA&lt;/javassist.version&gt;
  8. &lt;maven.build.timestamp.format&gt;yyyy-MM-dd&#39;T&#39;HH.mm.ss&lt;/maven.build.timestamp.format&gt;
  9. &lt;/properties&gt;
  10. &lt;parent&gt;
  11. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  12. &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
  13. &lt;version&gt;2.3.1.RELEASE&lt;/version&gt;
  14. &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
  15. &lt;/parent&gt;
  16. &lt;dependency&gt;
  17. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  18. &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
  19. &lt;/dependency&gt;
  20. &lt;dependency&gt;
  21. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  22. &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
  23. &lt;/dependency&gt;
  24. &lt;dependency&gt;
  25. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  26. &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
  27. &lt;/dependency&gt;
  28. &lt;dependency&gt;
  29. &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
  30. &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
  31. &lt;scope&gt;runtime&lt;/scope&gt;
  32. &lt;/dependency&gt;
  33. &lt;dependency&gt;
  34. &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
  35. &lt;artifactId&gt;liquibase-core&lt;/artifactId&gt;
  36. &lt;/dependency&gt;
  37. ...
  38. &lt;build&gt;
  39. &lt;plugins&gt;
  40. &lt;plugin&gt;
  41. &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
  42. &lt;artifactId&gt;liquibase-maven-plugin&lt;/artifactId&gt;
  43. &lt;version&gt;${liquibase.version}&lt;/version&gt;
  44. &lt;configuration&gt;
  45. &lt;propertyFile&gt;src/main/resources/liquibase-${activatedProperties}.properties&lt;/propertyFile&gt;
  46. &lt;outputChangeLogFile&gt;src/main/resources/db/db.changelog-${activatedProperties}.xml&lt;/outputChangeLogFile&gt;
  47. &lt;changeLogFile&gt;src/main/resources/db/db.changelog-${activatedProperties}.xml&lt;/changeLogFile&gt;
  48. &lt;diffChangeLogFile&gt;src/main/resources/db/changelog/${activatedProperties}/${maven.build.timestamp}_changelog.xml&lt;/diffChangeLogFile&gt;
  49. &lt;diffTypes&gt;tables,columns,indexes,foreignkeys,primarykeys,uniqueconstraints&lt;/diffTypes&gt;
  50. &lt;!-- diffTypes=tables, views, columns, indexes, foreignkeys, primarykeys, uniqueconstraints, data --&gt;
  51. &lt;logging&gt;info&lt;/logging&gt;
  52. &lt;/configuration&gt;
  53. &lt;!-- Liquibase dependencies--&gt;
  54. &lt;dependencies&gt;
  55. &lt;dependency&gt;
  56. &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
  57. &lt;artifactId&gt;liquibase-core&lt;/artifactId&gt;
  58. &lt;version&gt;${liquibase.version}&lt;/version&gt;
  59. &lt;/dependency&gt;
  60. &lt;dependency&gt;
  61. &lt;groupId&gt;org.liquibase.ext&lt;/groupId&gt;
  62. &lt;artifactId&gt;liquibase-hibernate5&lt;/artifactId&gt;
  63. &lt;version&gt;${liquibase-hibernate5.version}&lt;/version&gt;
  64. &lt;/dependency&gt;
  65. &lt;dependency&gt;
  66. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  67. &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
  68. &lt;version&gt;${spring-boot.version}&lt;/version&gt;
  69. &lt;/dependency&gt;
  70. &lt;dependency&gt;
  71. &lt;groupId&gt;javax.validation&lt;/groupId&gt;
  72. &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
  73. &lt;version&gt;${javax-validation.version}&lt;/version&gt;
  74. &lt;/dependency&gt;
  75. &lt;dependency&gt;
  76. &lt;groupId&gt;org.javassist&lt;/groupId&gt;
  77. &lt;artifactId&gt;javassist&lt;/artifactId&gt;
  78. &lt;version&gt;${javassist.version}&lt;/version&gt;
  79. &lt;/dependency&gt;
  80. &lt;dependency&gt;
  81. &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
  82. &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
  83. &lt;version&gt;${javax-jaxb.version}&lt;/version&gt;
  84. &lt;/dependency&gt;
  85. &lt;dependency&gt;
  86. &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
  87. &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
  88. &lt;version&gt;${postgresql.version}&lt;/version&gt;
  89. &lt;/dependency&gt;
  90. &lt;/dependencies&gt;
  91. &lt;/plugin&gt;
  92. &lt;plugin&gt;
  93. ...

In this pom in the pluggin section you will see version numbers properties, the values are inherited from the SpringBoot pom, no more hard coded in my own pom.

Now running fine in Docker !
If you have the same issue and my answer does not allow you to solve it, drop a comment i will add the other changes i also made, that for the moment, I doubt had any impact.

huangapple
  • 本文由 发表于 2020年9月1日 14:09:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/63682268.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定