From 1f07d3cf9813127421d3e68765a0782b7c69cc2c Mon Sep 17 00:00:00 2001 From: JohnKeeney Date: Mon, 3 Apr 2023 13:24:52 +0100 Subject: [PATCH] Update to JDK 17 & Springboot 3 Change-Id: I4bcfb8b058030fc959915761251920a76620926a Issue-ID: NONRTRIC-841 Signed-off-by: JohnKeeney --- nonrtric-gateway/Dockerfile | 22 ++- nonrtric-gateway/eclipse-formatter.xml | 1 - nonrtric-gateway/pom.xml | 310 ++++++++++++++++----------------- pom.xml | 13 +- webapp-frontend/pom.xml | 4 +- 5 files changed, 185 insertions(+), 165 deletions(-) diff --git a/nonrtric-gateway/Dockerfile b/nonrtric-gateway/Dockerfile index 5472edf..4fc663d 100644 --- a/nonrtric-gateway/Dockerfile +++ b/nonrtric-gateway/Dockerfile @@ -17,7 +17,25 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= # -FROM openjdk:11-jre-slim +FROM openjdk:17-jdk as jre-build + +RUN $JAVA_HOME/bin/jlink \ +--verbose \ +--add-modules ALL-MODULE-PATH \ +--strip-debug \ +--no-man-pages \ +--no-header-files \ +--compress=2 \ +--output /customjre + +# Use debian base image (same as openjdk uses) +FROM debian:11-slim + +ENV JAVA_HOME=/jre +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +#copy JRE from the base image +COPY --from=jre-build /customjre $JAVA_HOME ARG JAR @@ -39,4 +57,4 @@ RUN chown -R $user:$group /var/log/nonrtric-gateway USER ${user} -CMD ["java", "-jar", "/opt/app/nonrtric-gateway/nonrtric-gateway.jar"] +CMD ["/jre/bin/java", "-jar", "/opt/app/nonrtric-gateway/nonrtric-gateway.jar"] diff --git a/nonrtric-gateway/eclipse-formatter.xml b/nonrtric-gateway/eclipse-formatter.xml index c5412d9..94eb972 100644 --- a/nonrtric-gateway/eclipse-formatter.xml +++ b/nonrtric-gateway/eclipse-formatter.xml @@ -1,5 +1,4 @@ - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.4.1 - - - org.o-ran-sc.nonrtric - nonrtric-gateway - 1.1.0-SNAPSHOT - Nonrtric Gateway - Nonrtric Gateway + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.0.4 + + + org.o-ran-sc.nonrtric + nonrtric-gateway + 1.2.0-SNAPSHOT + Nonrtric Gateway + Nonrtric Gateway - - 11 - 2020.0.0 - 2.13.0 - 2.5.0 - 0.30.0 - + + 17 + 2022.0.2 + 2.13.0 + 2.30.0 + 0.30.0 + - - - org.springframework.cloud - spring-cloud-starter-gateway - + + + org.springframework.cloud + spring-cloud-starter-gateway + - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-actuator - runtime - - + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-actuator + runtime + + - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - net.revelc.code.formatter - formatter-maven-plugin - ${formatter-maven-plugin.version} - - LF - ${project.basedir}/eclipse-formatter.xml - - - - - com.diffplug.spotless - spotless-maven-plugin - ${spotless-maven-plugin.version} - - UNIX - - - - com,java,javax,org - - - - - - - - - - docker - - - - io.fabric8 - docker-maven-plugin - ${docker-maven-plugin.version} - false - - - generate-nonrtric-gateway-image - package - - build - - - ${env.CONTAINER_PULL_REGISTRY} - - - o-ran-sc/nonrtric-gateway:${project.version} - - try - ${basedir} - Dockerfile - - ${project.build.finalName}.jar - - - ${project.version} - - - - - - - - push-nonrtric-gateway-image - - build - push - - - ${env.CONTAINER_PULL_REGISTRY} - ${env.CONTAINER_PUSH_REGISTRY} - - - o-ran-sc/nonrtric-gateway:${project.version} - - ${basedir} - Dockerfile - - ${project.build.finalName}.jar - - - ${project.version} - latest - - - - - - - - - - - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + net.revelc.code.formatter + formatter-maven-plugin + ${formatter-maven-plugin.version} + + LF + ${project.basedir}/eclipse-formatter.xml + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless-maven-plugin.version} + + UNIX + + + + com,java,javax,org + + + + + + + + + + docker + + + + io.fabric8 + docker-maven-plugin + ${docker-maven-plugin.version} + false + + + generate-nonrtric-gateway-image + package + + build + + + ${env.CONTAINER_PULL_REGISTRY} + + + o-ran-sc/nonrtric-gateway:${project.version} + + try + ${basedir} + Dockerfile + false + + ${project.build.finalName}.jar + + + ${project.version} + + + + + + + + push-nonrtric-gateway-image + + build + push + + + ${env.CONTAINER_PULL_REGISTRY} + ${env.CONTAINER_PUSH_REGISTRY} + + + o-ran-sc/nonrtric-gateway:${project.version} + + ${basedir} + Dockerfile + false + + ${project.build.finalName}.jar + + + ${project.version} + latest + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index ad2b41a..633db5c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,11 +3,16 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.o-ran-sc.nonrtric - nonrtric-controlpanel - 2.4.0-SNAPSHOT + nonrtric-controlpanel-root + 2.5.0-SNAPSHOT + pom + + nonrtric-gateway + webapp-frontend + - nonrtric-gateway/**/* - nonrtric-gateway/**/* + nonrtric-gateway/**/* + nonrtric-gateway/**/* nonrtric-gateway/**/* diff --git a/webapp-frontend/pom.xml b/webapp-frontend/pom.xml index c129a92..13d2900 100644 --- a/webapp-frontend/pom.xml +++ b/webapp-frontend/pom.xml @@ -24,9 +24,9 @@ 4.0.0 org.o-ran-sc.nonrtric nonrtric-controlpanel - 2.4.0-SNAPSHOT + 2.5.0-SNAPSHOT Nonrtric Controlpanel - Nonrtric Controlpanel + NonRTRIC Controlpanel 0.30.0 -- 2.16.6