I use maven to run unit and integration tests, and flyway migrations. My machine timezone is set to +2:00. How can override this so that all actions triggered by maven eg:
mvn flyway:migrate
use UTC as the timezone?
I use maven to run unit and integration tests, and flyway migrations. My machine timezone is set to +2:00. How can override this so that all actions triggered by maven eg:
mvn flyway:migrate
use UTC as the timezone?
You can configure the TimeZone on the pom.xml of your application when you configure your flyway plugin like this.
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>6.0.4</version>
<configuration>
<user.timezone>UTC</user.timezone> //In case of Java 7 or
<argLine>-Duser.timezone=UTC</argLine> //Incase of Java 8 and above.
</configuration>
</plugin>
You can refer this answer for more details and this for details of Flyway maven configurations.
A colleague suggested the following argument to the maven invocation
mvn <target> -Duser.timezone=UTC