Skip to content

chore: JDK24 LTS #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/feature-mvn-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 21
uses: actions/setup-java@v3
# - name: Set up JDK 21
# uses: actions/setup-java@v3
# with:
# java-version: '21'
# distribution: 'temurin'
# cache: maven

- name: Set up Amazon Corretto
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
distribution: 'corretto'
java-version: 24
cache: maven

- name: Build project
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/sonar-cloud-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v3
# - name: Set up JDK 21
# uses: actions/setup-java@v3
# with:
# java-version: '21'
# distribution: 'temurin'
# cache: maven

- name: Set up Amazon Corretto
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
distribution: 'corretto'
java-version: 24
cache: maven

- name: Build
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
14 changes: 13 additions & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
FROM ubuntu:24.04 AS build-common
WORKDIR /build

# Install necessary tools but not OpenJDK from apt
RUN apt update --fix-missing \
&& apt install -y --no-install-recommends openjdk-21-jdk maven curl ca-certificates \
&& apt install -y --no-install-recommends maven curl ca-certificates \
&& apt clean

# Download and setup JDK 24.0.1
RUN mkdir -p /opt/java \
&& curl -L https://download.java.net/java/GA/jdk24.0.1/24a58e0e276943138bf3e963e6291ac2/9/GPL/openjdk-24.0.1_linux-x64_bin.tar.gz -o /opt/jdk.tar.gz \
&& tar -xzf /opt/jdk.tar.gz -C /opt/java \
&& rm /opt/jdk.tar.gz

# Set JAVA_HOME and update PATH
ENV JAVA_HOME=/opt/java/jdk-24.0.1
ENV PATH="${JAVA_HOME}/bin:${PATH}"

COPY ./pom.xml /build/pom.xml
COPY ./api /build/api
COPY ./yaci-indexer /build/yaci-indexer
COPY ./test-data-generator /build/test-data-generator
COPY ./.git .git

RUN --mount=type=cache,target=/root/.m2 mvn -U clean package -DskipTests
RUN java --version

WORKDIR /app
RUN cp /build/api/target/*.jar /app/api.jar
Expand Down
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven-compiler-plugin}</version>
<configuration>
<release>21</release>
<release>24</release>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
Expand Down
26 changes: 24 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ RUN apt update --fix-missing \
g++ tmux git jq wget libncursesw5-dev libtool autoconf liblmdb-dev curl ca-certificates pkg-config \
&& apt-get clean

# Download and setup JDK 24.0.1
RUN mkdir -p /opt/java \
&& curl -L https://download.java.net/java/GA/jdk24.0.1/24a58e0e276943138bf3e963e6291ac2/9/GPL/openjdk-24.0.1_linux-x64_bin.tar.gz -o /opt/jdk.tar.gz \
&& tar -xzf /opt/jdk.tar.gz -C /opt/java \
&& rm /opt/jdk.tar.gz

# Set JAVA_HOME and update PATH
ENV JAVA_HOME=/opt/java/jdk-24.0.1
ENV PATH="${JAVA_HOME}/bin:${PATH}"

WORKDIR /root/src

# Install ghcup
Expand Down Expand Up @@ -149,7 +159,7 @@ FROM ubuntu:24.04 AS java-builder
WORKDIR /root/app

RUN apt update --fix-missing \
&& apt install -y --no-install-recommends openjdk-21-jdk maven \
&& apt install -y --no-install-recommends maven \
&& apt-get clean

COPY ./pom.xml /root/app/pom.xml
Expand All @@ -159,7 +169,9 @@ COPY ./yaci-indexer /root/app/yaci-indexer
COPY ./test-data-generator /root/app/test-data-generator
COPY ./.git /root/app/.git

RUN --mount=type=cache,target=/root/.m2 mvn -U clean package -DskipTests
RUN java --version

RUN --mount=type=cache,target=/root/.m2 mvn clean package -am -DskipTests

# Main
FROM ubuntu:24.04
Expand Down Expand Up @@ -195,6 +207,16 @@ RUN rm -rf /var/lib/postgresql/${PG_VERSION}/main
RUN apt install -y --no-install-recommends jq bc sudo curl \
&& apt clean

# Download and setup JDK 24.0.1
RUN mkdir -p /opt/java \
&& curl -L https://download.java.net/java/GA/jdk24.0.1/24a58e0e276943138bf3e963e6291ac2/9/GPL/openjdk-24.0.1_linux-x64_bin.tar.gz -o /opt/jdk.tar.gz \
&& tar -xzf /opt/jdk.tar.gz -C /opt/java \
&& rm /opt/jdk.tar.gz

# Set JAVA_HOME and update PATH
ENV JAVA_HOME=/opt/java/jdk-24.0.1
ENV PATH="${JAVA_HOME}/bin:${PATH}"

# Copy cardano node
COPY --from=cardano-builder /usr/local/lib /usr/local/lib
COPY --from=cardano-builder /root/.local/bin/cardano-* /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<properties>
<maven.compiler.proc>full</maven.compiler.proc>
<revision>1.2.8</revision>
<java.version>21</java.version>
<java.version>24</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.spring-boot>3.4.4</version.spring-boot>
<version.springdoc-openapi-ui>1.6.15</version.springdoc-openapi-ui>
Expand Down
2 changes: 1 addition & 1 deletion test-data-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven-compiler-plugin}</version>
<configuration>
<release>21</release>
<release>24</release>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
Expand Down
13 changes: 12 additions & 1 deletion yaci-indexer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,27 @@ FROM ubuntu:24.04 AS build-common
WORKDIR /build

RUN apt update --fix-missing \
&& apt install -y --no-install-recommends openjdk-21-jdk maven curl \
&& apt install -y --no-install-recommends maven curl \
&& apt clean

# Download and setup JDK 24.0.1
RUN mkdir -p /opt/java \
&& curl -L https://download.java.net/java/GA/jdk24.0.1/24a58e0e276943138bf3e963e6291ac2/9/GPL/openjdk-24.0.1_linux-x64_bin.tar.gz -o /opt/jdk.tar.gz \
&& tar -xzf /opt/jdk.tar.gz -C /opt/java \
&& rm /opt/jdk.tar.gz

# Set JAVA_HOME and update PATH
ENV JAVA_HOME=/opt/java/jdk-24.0.1
ENV PATH="${JAVA_HOME}/bin:${PATH}"

COPY ./pom.xml /build/pom.xml
COPY ./api /build/api
COPY ./yaci-indexer /build/yaci-indexer
COPY ./test-data-generator /build/test-data-generator
COPY ./.git .git

RUN --mount=type=cache,target=/root/.m2 mvn -U clean package -DskipTests
RUN java --version

WORKDIR /app
RUN cp /build/yaci-indexer/target/*.jar /app/yaci-indexer.jar
Expand Down
4 changes: 2 additions & 2 deletions yaci-indexer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<packaging>jar</packaging>

<properties>
<java.version>21</java.version>
<java.version>24</java.version>
<maven.compiler.proc>full</maven.compiler.proc>
<yaci-store.version>0.1.2</yaci-store.version>
<sonar.exclusions>src/main/java/org/cardanofoundation/rosetta/yaciindexer/stores/txsize/model/*</sonar.exclusions>
Expand Down Expand Up @@ -121,7 +121,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven-compiler-plugin}</version>
<configuration>
<release>21</release>
<release>24</release>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
Expand Down