Skip to content

Commit

Permalink
Add flyway-maven-plugin to plugins and update flyway related configur…
Browse files Browse the repository at this point in the history
…ation

- fix dependency
- use main.basedir instead of basedir in path of flyway.properties and update url

This allows running `mvn flyway:migrate` from the source root directory.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jul 30, 2024
1 parent 9bef03d commit 4424252
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flyway.user=kitodo
flyway.password=kitodo
flyway.url=jdbc:mysql://localhost/kitodo?useSSL=false
flyway.locations=filesystem:../Kitodo-DataManagement/src/main/resources/db/migration
flyway.url=jdbc:mysql://localhost/kitodo
flyway.locations=filesystem:Kitodo-DataManagement/src/main/resources/db/migration
39 changes: 35 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,37 @@ from system library in Java 11+ -->
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway-maven-plugin.version}</version>
<configuration>
<configFiles>
<!-- local configuration file -->
<!--<configFile>${main.basedir}/config-local/flyway.properties</configFile>-->
<configFile>
${main.basedir}/Kitodo-DataManagement/src/main/resources/db/config/flyway.properties
</configFile>
</configFiles>
</configuration>
<dependencies>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
<version>${flyway-maven-plugin.version}</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb-java-client.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -1016,16 +1047,16 @@ from system library in Java 11+ -->
<configuration>
<configFiles>
<!-- local configuration file -->
<!--<configFile>${basedir}/config-local/flyway.properties</configFile>-->
<!--<configFile>${main.basedir}/config-local/flyway.properties</configFile>-->
<configFile>
${basedir}/Kitodo-DataManagement/src/main/resources/db/config/flyway.properties
${main.basedir}/Kitodo-DataManagement/src/main/resources/db/config/flyway.properties
</configFile>
</configFiles>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
Expand Down

0 comments on commit 4424252

Please sign in to comment.