Skip to content

Commit

Permalink
[java] upgrade to java 17 (#1293)
Browse files Browse the repository at this point in the history
* [java] upgrade github actions to java 17

* [java] upgrade DockerFile to java 17

* [java] update README to java 17

* [java] migrate codebase to java 17
  • Loading branch information
cyrilou242 authored Jan 16, 2024
1 parent a867794 commit 7b9b21c
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 66 deletions.
42 changes: 0 additions & 42 deletions .github/thirdeye-server-tests.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/check-license-header.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'
# don't use setup-java cache - hash file pattern has issues
- name: Cache local Maven repository
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
steps:
- name: Pull repository
uses: actions/checkout@v3
- name: Install JDK 11
- name: Install JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Cache - restore local Maven repository
id: cache-restore
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
cache: "npm"
cache-dependency-path: './thirdeye-ui/package-lock.json'
# java is required to get the backend project version with maven
- name: Install JDK 11
- name: Install JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Generate frontend distribution
id: generate-frontend-dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ jobs:
steps:
- name: Pull repository
uses: actions/checkout@v3
- name: Install JDK 11
- name: Install JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: Set git ci user info
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Install java and setup artifactory
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'
server-id: startree-releases
server-username: ARTIFACTORY_USERNAME_REF
server-password: ARTIFACTORY_TOKEN_REF
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# the License.
#

FROM eclipse-temurin:11-jdk-alpine as builder
FROM eclipse-temurin:17-jdk-alpine as builder
# build jcmd tools to make them available at runtime
RUN ${JAVA_HOME}/bin/jlink --module-path jmods --add-modules jdk.jcmd --output /jcmd
WORKDIR /build
Expand All @@ -21,7 +21,7 @@ COPY ./ ./
# if the disitrbution is provided, do nothing - else build it
RUN if [[ ! -d thirdeye-distribution/target/thirdeye-distribution-*-dist/thirdeye-distribution-* ]]; then ./mvnw package -U -DskipTests; fi

FROM eclipse-temurin:11-jre-alpine
FROM eclipse-temurin:17-jre-alpine
RUN addgroup -g 1000 thirdeye && \
adduser -u 1000 thirdeye -G thirdeye -D

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ For a complete description of ThirdEye's features, see [**ThirdEye documentation

### Requirements
- tested on Linux and Mac OS
- Java 11
- Java 17
- MySQL 8.0
- the UI requires internal npm packages. Make sure you can access them. See [thirdeye-ui prerequisites](./thirdeye-ui/README.md#configure-node-package-manager-npm-for-use-with-artifactory)

Expand Down
10 changes: 3 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
</modules>

<properties>
<jdk.version>11</jdk.version>
<jdk.version>17</jdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- Dependency Versions -->
<!-- Please maintain a sorted list -->
<!-- Intellij: Search actions (Press shift twice), type "sort lines", then enter :-) -->
<aspectj.version>1.9.6</aspectj.version>
<aspectj.version>1.9.21</aspectj.version>
<assertj.version>3.17.2</assertj.version>
<auto-service.version>1.0.1</auto-service.version>
<calcite.version>1.36.0</calcite.version>
Expand Down Expand Up @@ -267,12 +267,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<!-- See https://winterbe.com/posts/2018/08/29/migrate-maven-projects-to-java-11-jigsaw/ -->
<argLine>
--illegal-access=permit
</argLine>
<argLine>
-javaagent:"${settings.localRepository}"/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
-javaagent:"${settings.localRepository}"/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
</argLine>
<threadCount>1</threadCount>
<systemPropertyVariables>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* - wait for detection task to run. Check lastTimestamp
*
* Note: if run within IntelliJ, run with the following JVM option:
* -javaagent:[USER_PATH]/.m2/repository/org/aspectj/aspectjweaver/1.9.6/aspectjweaver-1.9.6.jar
* -javaagent:[USER_PATH]/.m2/repository/org/aspectj/aspectjweaver/1.9.21/aspectjweaver-1.9.21.jar --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
* IntelliJ does not use the pom surefire config: https://youtrack.jetbrains.com/issue/IDEA-52286
*/
public class SchedulingTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* This class uses weaving to control the java system time.
*
* Note: if run within IntelliJ, run with the following JVM option:
* -javaagent:[USER_PATH]/.m2/repository/org/aspectj/aspectjweaver/1.9.6/aspectjweaver-1.9.6.jar
* -javaagent:[USER_PATH]/.m2/repository/org/aspectj/aspectjweaver/1.9.21/aspectjweaver-1.9.21.jar --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
* IntelliJ does not use the pom surefire config: https://youtrack.jetbrains.com/issue/IDEA-52286
*
* In command line: ./mvnw -pl 'thirdeye-persistence' -Dtest=TestAnomalyJobManager test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* This class uses weaving to control the java system time.
*
* Note: if run within IntelliJ, run with the following JVM option:
* -javaagent:[USER_PATH]/.m2/repository/org/aspectj/aspectjweaver/1.9.6/aspectjweaver-1.9.6.jar
* -javaagent:[USER_PATH]/.m2/repository/org/aspectj/aspectjweaver/1.9.21/aspectjweaver-1.9.21.jar --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
* IntelliJ does not use the pom surefire config: https://youtrack.jetbrains.com/issue/IDEA-52286
*
* In command line: ./mvnw -pl 'thirdeye-persistence' -Dtest=TestAnomalyTaskManager test
Expand Down

0 comments on commit 7b9b21c

Please sign in to comment.