diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-17 15:26:08 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-18 15:43:41 +0200 |
commit | 1a0763c2cfb23de0c690136d8e66df98e3844192 (patch) | |
tree | 8d3d76c468fcc326e13d21c629d684ac518cae77 | |
parent | fec75c941420be1c637112e9f404ed4553dba66f (diff) |
Use Java 11 in resources1.14.7
- update aai-common to 1.14.7
- change compiler and base image to Java 11
- do not use all schema versions in tests since that increases test duration
Issue-ID: AAI-3996
Change-Id: I2bb86c7ae0ad5bdce1784fdd1e64b3573723061b
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
-rw-r--r-- | aai-resources/pom.xml | 2 | ||||
-rw-r--r-- | aai-resources/src/main/docker/Dockerfile | 2 | ||||
-rw-r--r-- | aai-resources/src/main/docker/docker-entrypoint.sh | 20 | ||||
-rw-r--r-- | aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java | 6 | ||||
-rw-r--r-- | aai-resources/src/test/resources/application-test.properties | 2 | ||||
-rw-r--r-- | aai-resources/src/test/resources/it/application-keycloak-test.properties | 2 | ||||
-rw-r--r-- | onap-java-formatter.xml | 6 | ||||
-rw-r--r-- | pom.xml | 4 |
8 files changed, 16 insertions, 28 deletions
diff --git a/aai-resources/pom.xml b/aai-resources/pom.xml index 1c43954..83c6c92 100644 --- a/aai-resources/pom.xml +++ b/aai-resources/pom.xml @@ -31,7 +31,7 @@ <version>1.14.7-SNAPSHOT</version> </parent> <properties> - <java.version>1.8</java.version> + <java.version>11</java.version> <start-class>org.onap.aai.ResourcesApp</start-class> <!-- Default docker registry that maven fabric plugin will try to pull from --> diff --git a/aai-resources/src/main/docker/Dockerfile b/aai-resources/src/main/docker/Dockerfile index 5c943c8..b15abf9 100644 --- a/aai-resources/src/main/docker/Dockerfile +++ b/aai-resources/src/main/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:8-jre-alpine +FROM eclipse-temurin:11-jre-alpine USER nobody ENV SERVER_PORT=8447 diff --git a/aai-resources/src/main/docker/docker-entrypoint.sh b/aai-resources/src/main/docker/docker-entrypoint.sh index b946d85..849c5d2 100644 --- a/aai-resources/src/main/docker/docker-entrypoint.sh +++ b/aai-resources/src/main/docker/docker-entrypoint.sh @@ -26,24 +26,14 @@ export SERVER_PORT=${SERVER_PORT:-8447}; USER_ID=${LOCAL_USER_ID:-9001} GROUP_ID=${LOCAL_GROUP_ID:-9001} -if [ ! -z "${HEAP_SIZE}" ]; then - MIN_HEAP_SIZE=${HEAP_SIZE}; - MAX_HEAP_SIZE=${HEAP_SIZE}; -fi; - -MIN_HEAP_SIZE=${MIN_HEAP_SIZE:-512m}; -MAX_HEAP_SIZE=${MAX_HEAP_SIZE:-1024m}; MAX_METASPACE_SIZE=${MAX_METASPACE_SIZE:-512m}; JAVA_CMD="exec java"; -JVM_OPTS="${PRE_JVM_ARGS} -Xloggc:/opt/app/aai-resources/logs/gc/aai_gc.log"; +JVM_OPTS="${PRE_JVM_ARGS}"; JVM_OPTS="${JVM_OPTS} -XX:HeapDumpPath=/opt/app/aai-resources/logs/ajsc-jetty/heap-dump"; -JVM_OPTS="${JVM_OPTS} -Xms${MIN_HEAP_SIZE}"; -JVM_OPTS="${JVM_OPTS} -Xmx${MAX_HEAP_SIZE}"; +JVM_OPTS="${JVM_OPTS} -XX:MaxRAMPercentage=${MAX_RAM_PERCENTAGE:-60}"; -JVM_OPTS="${JVM_OPTS} -XX:+PrintGCDetails"; -JVM_OPTS="${JVM_OPTS} -XX:+PrintGCTimeStamps"; JVM_OPTS="${JVM_OPTS} -XX:MaxMetaspaceSize=${MAX_METASPACE_SIZE}"; JVM_OPTS="${JVM_OPTS} -server"; @@ -51,16 +41,12 @@ JVM_OPTS="${JVM_OPTS} -XX:NewSize=512m"; JVM_OPTS="${JVM_OPTS} -XX:MaxNewSize=512m"; JVM_OPTS="${JVM_OPTS} -XX:SurvivorRatio=8"; JVM_OPTS="${JVM_OPTS} -XX:+DisableExplicitGC"; -JVM_OPTS="${JVM_OPTS} -verbose:gc"; -JVM_OPTS="${JVM_OPTS} -XX:+UseParNewGC"; +JVM_OPTS="${JVM_OPTS} -XX:+UseG1GC"; JVM_OPTS="${JVM_OPTS} -XX:+CMSParallelRemarkEnabled"; JVM_OPTS="${JVM_OPTS} -XX:+CMSClassUnloadingEnabled"; -JVM_OPTS="${JVM_OPTS} -XX:+UseConcMarkSweepGC"; JVM_OPTS="${JVM_OPTS} -XX:-UseBiasedLocking"; JVM_OPTS="${JVM_OPTS} -XX:ParallelGCThreads=4"; JVM_OPTS="${JVM_OPTS} -XX:LargePageSizeInBytes=128m"; -JVM_OPTS="${JVM_OPTS} -XX:+PrintGCDetails"; -JVM_OPTS="${JVM_OPTS} -XX:+PrintGCTimeStamps"; JVM_OPTS="${JVM_OPTS} -Dsun.net.inetaddr.ttl=180"; JVM_OPTS="${JVM_OPTS} -XX:+HeapDumpOnOutOfMemoryError"; JVM_OPTS="${JVM_OPTS} ${POST_JVM_ARGS}"; diff --git a/aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java b/aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java index 8e68e8e..ccbb68e 100644 --- a/aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java +++ b/aai-resources/src/main/java/org/onap/aai/web/JerseyConfiguration.java @@ -24,7 +24,6 @@ import static java.lang.Boolean.parseBoolean; import static java.util.Comparator.comparingInt; import com.google.common.collect.Sets; -import com.sun.jersey.api.client.filter.LoggingFilter; import java.lang.reflect.AnnotatedElement; import java.util.Collection; @@ -37,6 +36,7 @@ import javax.ws.rs.container.ContainerRequestFilter; import javax.ws.rs.container.ContainerResponseFilter; import javax.ws.rs.ext.ReaderInterceptor; +import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ResourceConfig; import org.onap.aai.rest.BulkAddConsumer; import org.onap.aai.rest.BulkProcessConsumer; @@ -119,7 +119,9 @@ public class JerseyConfiguration { } private void logRequests(ResourceConfig resourceConfig) { - resourceConfig.register(new LoggingFilter(log, ENABLE_RESPONSE_LOGGING ? null : 0)); + if(ENABLE_RESPONSE_LOGGING) { + resourceConfig.register(new LoggingFeature(log)); + } } private boolean isLoggingEnabled() { diff --git a/aai-resources/src/test/resources/application-test.properties b/aai-resources/src/test/resources/application-test.properties index b4cd460..3fcab50 100644 --- a/aai-resources/src/test/resources/application-test.properties +++ b/aai-resources/src/test/resources/application-test.properties @@ -58,7 +58,7 @@ schema.ingest.file=${server.local.startpath}/application.properties # Schema Version Related Attributes schema.uri.base.path=/aai # Lists all of the versions in the schema -schema.version.list=v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26,v27,v28,v29 +schema.version.list=v10,v11,v12,v13,v14,v29 # Specifies from which version should the depth parameter to default to zero schema.version.depth.start=v10 # Specifies from which version should the related link be displayed in response payload diff --git a/aai-resources/src/test/resources/it/application-keycloak-test.properties b/aai-resources/src/test/resources/it/application-keycloak-test.properties index db9b4b4..7a86d1a 100644 --- a/aai-resources/src/test/resources/it/application-keycloak-test.properties +++ b/aai-resources/src/test/resources/it/application-keycloak-test.properties @@ -14,4 +14,4 @@ keycloak.bearer-only=true multi.tenancy.enabled=true spring.profiles.active=production,keycloak -schema.version.list=v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20,v21,v22,v23,v24,v25,v26,v27,v28,v29 +schema.version.list=v10,v11,v12,v13,v14,v29 diff --git a/onap-java-formatter.xml b/onap-java-formatter.xml index 1dd9de6..afd15d6 100644 --- a/onap-java-formatter.xml +++ b/onap-java-formatter.xml @@ -2,11 +2,11 @@ <profiles version="12"> <profile kind="CodeFormatterProfile" name="onap-java-formatter" version="12"> <setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/> -<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/> -<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/> +<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="11"/> +<setting id="org.eclipse.jdt.core.compiler.compliance" value="11"/> <setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/> <setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/> -<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/> +<setting id="org.eclipse.jdt.core.compiler.source" value="11"/> <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="48"/> @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.14.6</version> + <version>1.14.7</version> </parent> <groupId>org.onap.aai.resources</groupId> <artifactId>resources</artifactId> @@ -48,7 +48,7 @@ <staging.path>/content/repositories/staging/</staging.path> <!-- GMaven plugin uses this property to figure out the name of the docker tag --> <aai.project.version>${project.version}</aai.project.version> - <aai.common.version>1.14.6</aai.common.version> + <aai.common.version>1.14.7</aai.common.version> <aai.schema.service.version>1.12.5</aai.schema.service.version> </properties> <dependencies> |