Skip to content

Commit

Permalink
java 21 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Nov 27, 2023
1 parent b96cd43 commit c987bce
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 126 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM gradle:6.8.3-jdk11 AS build
FROM --platform=$BUILDPLATFORM gradle:8.4.0-jdk21 AS build
ARG RELEASE_MODE
ARG APP_VERSION
WORKDIR /usr/app
Expand All @@ -10,11 +10,11 @@ RUN if [ "${RELEASE_MODE}" = true ]; then \
else gradle build --exclude-task test -Dorg.gradle.project.version=${APP_VERSION}; fi

# For ARM build use flag: `--platform linux/arm64`
FROM --platform=$BUILDPLATFORM amazoncorretto:11.0.20
FROM --platform=$BUILDPLATFORM amazoncorretto:21.0.1
LABEL version=${APP_VERSION} description="EPAM ReportPortal. Auth Service" maintainer="Andrei Varabyeu <[email protected]>, Hleb Kanonik <[email protected]>"
ARG APP_VERSION=${APP_VERSION}
ENV APP_DIR=/usr/app
ENV JAVA_OPTS="-Xmx1g -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom"
ENV JAVA_OPTS="-Xmx1g -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom --add-opens=java.base/java.lang=ALL-UNNAMED"
WORKDIR $APP_DIR
COPY --from=build $APP_DIR/build/libs/service-authorization-*exec.jar .
VOLUME ["/tmp"]
Expand Down
13 changes: 11 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.springframework.boot' version '2.5.15'
id 'java'
id "org.owasp.dependencycheck" version "5.3.1"
id "org.owasp.dependencycheck" version "8.2.1"
}

apply from: 'project-properties.gradle'
Expand Down Expand Up @@ -105,6 +105,15 @@ processResources {
}
}

tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
options.encoding = "UTF-8"
options.compilerArgs << "-parameters"
options.debug = true
options.debugOptions.debugLevel = "source,lines,vars"
}

bootJar {
System.getenv().containsKey("K8S") ? getArchiveFileName().set('app.jar') : archiveClassifier.set('exec')
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c987bce

Please sign in to comment.