Skip to content

Commit

Permalink
Migrate to Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
georgweiss committed Jan 11, 2024
1 parent c87bfff commit 59883d8
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/java-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Build with Maven
run: mvn clean verify
6 changes: 3 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand All @@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.source=17
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use Maven image to execute build.
FROM maven:3.6.3-openjdk-11 AS maven-build
FROM maven:3.6.3-openjdk-17 AS maven-build
RUN mkdir phoebus-olog
WORKDIR /phoebus-olog
COPY . .
Expand All @@ -10,9 +10,7 @@ RUN mvn clean install \
-Pdeployable-jar

# Use smaller openjdk image for running.
FROM openjdk:11
# apt clean is run automatically in debian-based images.
RUN apt update && apt install -y wait-for-it
FROM openjdk:17
# Run commands as user 'olog'
RUN useradd -ms /bin/bash olog
# Use previous maven-build image.
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile.integrationtest
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# ------------------------------------------------------------------------------

FROM openjdk:11
FROM openjdk:17

# apt clean is run automatically in debian-based images.
RUN apt update && apt install -y wait-for-it
# Run commands as user 'olog'
RUN useradd -ms /bin/bash olog

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Olog

* Prerequisites

* JDK 11 or newer
* JDK 17 or newer
* Elastic version 8.2.x
* mongo gridfs

Expand Down
72 changes: 45 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.phoebus</groupId>
<artifactId>service-olog</artifactId>
<version>4.7.8-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
<name>Phoebus Olog</name>
<description>An online logbook service that allows for the creation and retrieval of log entries.</description>
<url>https://github.com/Olog/phoebus-olog</url>
Expand Down Expand Up @@ -47,8 +48,8 @@
<connection>scm:git:git://github.com/Olog/phoebus-olog.git</connection>
<developerConnection>scm:git:https://github.com/Olog/phoebus-olog.git</developerConnection>
<url>https://github.com/Olog/phoebus-olog/tree/master</url>
<tag>HEAD</tag>
</scm>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -59,6 +60,7 @@
<skipITs>true</skipITs>
<skipITCoverage>true</skipITCoverage>
<jacoco.skip>true</jacoco.skip>
<jackson.version>2.14.3</jackson.version>
</properties>

<dependencyManagement>
Expand All @@ -78,10 +80,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>
</dependency> -->
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-mongodb-parent -->

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
Expand All @@ -100,13 +98,35 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.3</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.3</version>
<version>${jackson.version}</version>
</dependency>
<!--
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-parameter-names</artifactId>
<version>2.16.1</version>
</dependency>
-->



<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
Expand Down Expand Up @@ -228,7 +248,6 @@
</dependency>



</dependencies>
<build>
<!-- read properties from the pom file and add them to the application.properties -->
Expand All @@ -252,13 +271,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.5</version>
</plugin>
<!-- use self-contained integration tests - org.phoebus.olog.docker -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.2</version>
<version>3.2.5</version>
<configuration>
<skipITs>${skipITs}</skipITs>
<includes>
Expand All @@ -269,16 +288,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.12.1</version>
<configuration>
<source>11</source>
<target>11</target>
<source>17</source>
<target>17</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>copy</id>
Expand Down Expand Up @@ -314,7 +334,7 @@
<id>merge</id>
<phase>verify</phase>
<goals>
<goal>merge</goal>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
Expand Down Expand Up @@ -342,15 +362,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -363,7 +378,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.6.3</version>
<configuration>
<doclint>-missing</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -376,7 +394,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.0.1</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
Expand Down Expand Up @@ -405,7 +423,7 @@
<configuration>
<!-- add this to disable checking -->
<doclint>none</doclint>
<source>11</source>
<source>17</source>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -447,7 +465,7 @@
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
<version>3.2.2</version>
<executions>
<execution>
<goals>
Expand Down

0 comments on commit 59883d8

Please sign in to comment.