Skip to content

Commit

Permalink
Update Spring Boot 2.7 → 3.3 & Other Java libs
Browse files Browse the repository at this point in the history
* Spring Boot
  - `@Qualified` `TransactionManagers` for all DBs
* Spring Batch
  1. Updated Spring Batch config: Map based `JobRepository` is deprecated
     → HSQLDB used as the repo.
  2. Migrated ItemWriters to use the `Chunk<>` API.
  3. Migrated Repositiories to use `Iterable` as input type, so that
     Chunk<> Instanses can be directly passed in, without having to
     perform `toList()` transaformation.
  4. Change `Instant` to `LocalDateTime` on `JobStatus`.
  5. Swap Repo batch-insert 0-insert guard order:
     Before: `if (list.isEmpty()) { return; } for-loop`
     Now: `for-loop; if (batch.size() > 0) { execute() }`
     This is needed because if `List` → `Iterable` change of point 3.
* jOOQ
  - Disabled type generation for new spatial type support → Continue
    using the current Binding-class.
  - DateRange: Newer version of jOOQ do not work with org.immutable
    types → Replaced `DateRange` org.immutable implementation, with java
    Record.
  - Fix config to use `<binding>` instead of `<converter>`.
* Maven & other libs
  - Guava: 33.0.0 → 33.1.0
  - vavr: 0.10.3 → 0.10.4
  - immutables: 2.10.0 → 2.10.1
  - geotools: 29.1 → 31.1
  - wiremock: 2.27.2 → 3.6.0 And switch to -standalone version as to
    not have conflicting Netty versions with Spring.
  - HSQLDB: Added  version 2.7.3
  - Maven plugins:
    - Compiler: 3.11.0 → 3.13.0
    - Properties: 1.0.0 → 1.2.0
    - Enforcer: 3.0.0 → 3.5.0
      - Enforced Maven version to be the latest Maven 3 version 3.6.3
    - BuildHelper: 3.2.0 → 3.6.0
  • Loading branch information
Huulivoide committed Jun 12, 2024
1 parent e4b026c commit 0510dba
Show file tree
Hide file tree
Showing 235 changed files with 13,767 additions and 12,401 deletions.
83 changes: 58 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version>
<version>3.3.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>fi.hsl.jore</groupId>
Expand All @@ -16,29 +16,41 @@
<properties>
<java.version>17</java.version>

<!-- 3.6.3 is the last version of maven 3 that has been relased. Back in 2019 😬 -->
<maven-enforcer.plugin.mvn-min-version>3.6.3</maven-enforcer.plugin.mvn-min-version>

<!-- Library versions -->
<guava.version>33.0.0-jre</guava.version>
<vavr.version>0.10.3</vavr.version>
<immutables.version>2.10.0</immutables.version>
<geotools.version>29.1</geotools.version>
<guava.version>33.1.0-jre</guava.version>
<vavr.version>0.10.4</vavr.version>
<vavr-jackson.version>0.10.3</vavr-jackson.version>
<immutables.version>2.10.1</immutables.version>
<geotools.version>31.1</geotools.version>
<geojson-jackson.version>1.14</geojson-jackson.version>
<!-- Sticking to old 9.X version to avoid having to configure trusted certificates
or just blindly trust any SQL server certificate. -->
<mssql-jdbc.version>9.5.0.jre17-preview</mssql-jdbc.version>
<!-- Used as the DB for Spring Batch -->
<hsqldb.version>2.7.3</hsqldb.version>

<!-- Test library version -->
<quicktheories.version>0.26</quicktheories.version>
<wiremock.version>3.6.0</wiremock.version>
<assertj-db.version>2.0.2</assertj-db.version>
<jsonassert.version>1.5.1</jsonassert.version>

<!-- Maven plugins -->
<maven-compiler.plugin.version>3.11.0</maven-compiler.plugin.version>
<maven-properties.plugin.version>1.0.0</maven-properties.plugin.version>
<maven-compiler.plugin.version>3.13.0</maven-compiler.plugin.version>
<maven-properties.plugin.version>1.2.1</maven-properties.plugin.version>
<maven-enforcer.plugin.version>3.5.0</maven-enforcer.plugin.version>
<maven-build-helper.plugin.version>3.6.0</maven-build-helper.plugin.version>

<!-- Packaging -->
<build.profile.id>dev</build.profile.id>
<build.property.file>profiles/${build.profile.id}/config.properties</build.property.file>
<skip.jooq.generation>false</skip.jooq.generation>
<skip.flyway.migration>false</skip.flyway.migration>
<skip.integration.tests>false</skip.integration.tests>
<flyway.cleanDisabled>false</flyway.cleanDisabled>
</properties>

<repositories>
Expand Down Expand Up @@ -116,16 +128,25 @@
</dependency>

<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>2.27.2</version>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.wiremock</groupId>
<!-- Using the standalone version as the non-standalone version
conflicts with Spring's Netty version -->
<artifactId>wiremock-standalone</artifactId>
<version>${wiremock.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-db</artifactId>
<version>2.0.2</version>
<version>${assertj-db.version}</version>
<scope>test</scope>
</dependency>

Expand All @@ -144,7 +165,7 @@
<dependency>
<groupId>io.vavr</groupId>
<artifactId>vavr-jackson</artifactId>
<version>${vavr.version}</version>
<version>${vavr-jackson.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -183,6 +204,10 @@
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId>
</dependency>

<!--jOOQ-->
<dependency>
Expand All @@ -208,7 +233,7 @@
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.1</version>
<version>${jsonassert.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -288,7 +313,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<version>${maven-enforcer.plugin.version}</version>
<executions>
<execution>
<id>enforce-versions</id>
Expand All @@ -298,8 +323,8 @@
<configuration>
<rules>
<requireMavenVersion>
<message>You are running an older version of Maven. Maven >= 3.3.9 is required</message>
<version>[3.3.9,)</version>
<message>You are running an older version of Maven. Maven >= ${maven-enforcer.plugin.mvn-min-version} is required</message>
<version>[${maven-enforcer.plugin.mvn-min-version},)</version>
</requireMavenVersion>
<requireJavaVersion>
<message>You are running an incompatible version of Java. JDK ${java.version} is required</message>
Expand Down Expand Up @@ -417,6 +442,9 @@
</jdbc>
<generator>
<name>org.jooq.codegen.JavaGenerator</name>
<generate>
<spatialTypes>false</spatialTypes>
</generate>
<database>
<name>${jooq.generator.db.dialect}</name>
<includes>infrastructure_network.* | network.*</includes>
Expand Down Expand Up @@ -450,24 +478,26 @@
<includeSystemIndexes>false</includeSystemIndexes>
<forcedTypes>
<forcedType>
<name>GEOMETRY</name>
<userType>org.locationtech.jts.geom.LineString</userType>
<converter>fi.hsl.jore.importer.config.jooq.converter.geometry.LineStringBinding</converter>
<binding>fi.hsl.jore.importer.config.jooq.converter.geometry.LineStringBinding</binding>
<includeExpression>.*\.infrastructure_link_geog|.*\.infrastructure_link_shape</includeExpression>
</forcedType>
<forcedType>
<name>GEOMETRY</name>
<userType>org.locationtech.jts.geom.Point</userType>
<converter>fi.hsl.jore.importer.config.jooq.converter.geometry.PointBinding</converter>
<binding>fi.hsl.jore.importer.config.jooq.converter.geometry.PointBinding</binding>
<includeExpression>.*\.infrastructure_node_location | .*\.infrastructure_node_projected_location | .*\.scheduled_stop_point_location</includeExpression>
</forcedType>
<forcedType>
<userType>fi.hsl.jore.importer.config.jooq.converter.time_range.TimeRange</userType>
<converter>fi.hsl.jore.importer.config.jooq.converter.time_range.TimeRangeBinding</converter>
<binding>fi.hsl.jore.importer.config.jooq.converter.time_range.TimeRangeBinding</binding>
<includeExpression>.*\..*_SYS_PERIOD.*</includeExpression>
<includeTypes>.*</includeTypes>
</forcedType>
<forcedType>
<userType>fi.hsl.jore.importer.config.jooq.converter.date_range.DateRange</userType>
<converter>fi.hsl.jore.importer.config.jooq.converter.date_range.DateRangeBinding</converter>
<binding>fi.hsl.jore.importer.config.jooq.converter.date_range.DateRangeBinding</binding>
<includeExpression>.*\..*_DATE_RANGE</includeExpression>
<includeTypes>.*</includeTypes>
</forcedType>
Expand Down Expand Up @@ -545,31 +575,34 @@
<includeSystemIndexes>false</includeSystemIndexes>
<forcedTypes>
<forcedType>
<name>GEOMETRY</name>
<userType>org.locationtech.jts.geom.LineString</userType>
<converter>fi.hsl.jore.importer.config.jooq.converter.geometry.LineStringBinding</converter>
<binding>fi.hsl.jore.importer.config.jooq.converter.geometry.LineStringBinding</binding>
<includeExpression>.*\.shape</includeExpression>
</forcedType>
<forcedType>
<name>GEOMETRY</name>
<userType>org.locationtech.jts.geom.Point</userType>
<converter>fi.hsl.jore.importer.config.jooq.converter.geometry.PointBinding</converter>
<binding>fi.hsl.jore.importer.config.jooq.converter.geometry.PointBinding</binding>
<includeExpression>.*\.measured_location</includeExpression>
</forcedType>
<forcedType>
<userType>fi.hsl.jore.importer.config.jooq.converter.time_range.TimeRange</userType>
<converter>fi.hsl.jore.importer.config.jooq.converter.time_range.TimeRangeBinding</converter>
<binding>fi.hsl.jore.importer.config.jooq.converter.time_range.TimeRangeBinding</binding>
<includeExpression>.*\..*_SYS_PERIOD.*</includeExpression>
<includeTypes>.*</includeTypes>
</forcedType>
<forcedType>
<userType>fi.hsl.jore.importer.config.jooq.converter.date_range.DateRange</userType>
<converter>fi.hsl.jore.importer.config.jooq.converter.date_range.DateRangeBinding</converter>
<binding>fi.hsl.jore.importer.config.jooq.converter.date_range.DateRangeBinding</binding>
<includeExpression>.*\..*_DATE_RANGE</includeExpression>
<includeTypes>.*</includeTypes>
</forcedType>
</forcedTypes>
</database>
<generate>
<records>false</records>
<spatialTypes>false</spatialTypes>
</generate>
<target>
<packageName>fi.hsl.jore.jore4.jooq</packageName>
Expand All @@ -594,7 +627,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<version>${maven-build-helper.plugin.version}</version>
<executions>
<execution>
<id>add-source</id>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0510dba

Please sign in to comment.