1

I'm working in an application developed with Spring5 (not Spring boot!) that runs on Jetty. This application has module that uses the plugin liquibase-maven-plugin.

We generate a image from a dockerfile (base image jetty:9-jre8), where we add the application (war file) in the jetty application directory.

In some specific environments, where I deploy the application, I want to be able to disable that execution.

Is it possible to do so? I've seen on spring boot documentation, that it's possible to do so by defining the property spring.liquibase.enabled (or liquibase.enabled on Spring4) to false, but that seems that doesn't work:

I've tried to define them at the properties file, define them as env properties and also as java options (-Dspring.liquibase.enabled=false).

This has the same behavior when I deploy the container, or when I execute locally the maven command: mvn jetty:run

Do you have any ideas or hints how to do this?

Thank you in advance

rfc
  • 21
  • 3
  • Welcome to Stackoverflow. We need more details. Lets start with ... edit your question and explain how you start Jetty and how you deploy your application. – Joakim Erdfelt Mar 11 '22 at 14:14
  • @JoakimErdfelt Thank you! I've edit and added more info as you requested. – rfc Mar 11 '22 at 14:50
  • What (jetty) modules do you enable in your docker image? One of them is likely causing the JVM to fork, which would explain why your efforts seem to not work. – Joakim Erdfelt Mar 11 '22 at 19:15

1 Answers1

1

Well I just discovered that it's possible to disable the execution of liquibase by adding the JAVA_OPTION
-Dliquibase.shouldRun=false

For more details see here

I will keep this quesion anyway, in case someone has the same problem I did.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
rfc
  • 21
  • 3