Migrate JAXB to jakarta 92/138992/2
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Sat, 21 Sep 2024 19:53:49 +0000 (21:53 +0200)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Sun, 22 Sep 2024 16:18:29 +0000 (18:18 +0200)
- change javax.* JAXB packages to jakarta.*
- bump snapshot version to 1.15.0-SNAPSHOT

Issue-ID: AAI-4005
Change-Id: I5bf2735c5ef53c9162a56f6b5f78e02992a0e2a0
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
aai-traversal/pom.xml
aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java
aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java
aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java
aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java
aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java
pom.xml
version.properties

index f572ac5..66ab01d 100644 (file)
@@ -26,7 +26,7 @@
        <parent>
                <groupId>org.onap.aai.traversal</groupId>
                <artifactId>traversal</artifactId>
-               <version>1.14.7-SNAPSHOT</version>
+               <version>1.15.0-SNAPSHOT</version>
        </parent>
        <groupId>org.onap.aai.traversal</groupId>
        <artifactId>aai-traversal</artifactId>
                        <version>2.1</version>
                </dependency>
                <dependency>
-                       <groupId>javax.xml.bind</groupId>
-                       <artifactId>jaxb-api</artifactId>
+                       <groupId>jakarta.xml.bind</groupId>
+                       <artifactId>jakarta.xml.bind-api</artifactId>
                </dependency>
                <dependency>
-                       <groupId>com.sun.xml.bind</groupId>
-                       <artifactId>jaxb-impl</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>com.sun.xml.bind</groupId>
-                       <artifactId>jaxb-core</artifactId>
+                       <groupId>org.glassfish.jaxb</groupId>
+                       <artifactId>jaxb-runtime</artifactId>
                </dependency>
                <dependency>
                        <groupId>net.sf.jopt-simple</groupId>
                <dependency>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok</artifactId>
-                       <version>1.18.30</version>
+                       <version>1.18.34</version>
                        <scope>provided</scope>
                </dependency>
        </dependencies>
index 005d3dc..f262ac4 100644 (file)
@@ -269,7 +269,7 @@ public class ModelBasedProcessing {
                 try {
                     Optional<Vertex> result = dbMethHelper.searchVertexByIdentityMap(modTopNodeType,
                         startNodeFilterArrayOfHashes.get(i));
-                    if (!result.isPresent()) {
+                    if (result.isEmpty()) {
                         throw new AAIException("AAI_6114",
                             "No Node of type " + modTopNodeType + " found for properties");
                     }
@@ -710,7 +710,7 @@ public class ModelBasedProcessing {
 
             Optional<Vertex> result =
                 dbMethHelper.searchVertexByIdentityMap(topNodeTypeVal, startNodeFilterHash);
-            if (!result.isPresent()) {
+            if (result.isEmpty()) {
                 throw new AAIException("AAI_6114",
                     "No Node of type " + topNodeTypeVal + " found for properties");
             }
@@ -741,7 +741,7 @@ public class ModelBasedProcessing {
             }
             Optional<Vertex> result =
                 dbMethHelper.locateUniqueVertex(widgModNodeType, startNodeFilterHash);
-            if (!result.isPresent()) {
+            if (result.isEmpty()) {
                 throw new AAIException("AAI_6114",
                     "No Node of type " + topNType + " found for properties");
             }
@@ -794,7 +794,7 @@ public class ModelBasedProcessing {
         // Locate the starting node that we'll use to start looking for instance data
         Optional<Vertex> result =
             dbMethHelper.searchVertexByIdentityMap(topNType, startNodeFilterHash);
-        if (!result.isPresent()) {
+        if (result.isEmpty()) {
             throw new AAIException("AAI_6114",
                 "No Node of type " + topNType + " found for properties");
         }
@@ -2093,7 +2093,7 @@ public class ModelBasedProcessing {
             propHash.put(targetProp, valFromInstance);
 
             Optional<Vertex> result = dbMethHelper.locateUniqueVertex(targetNodeType, propHash);
-            if (!result.isPresent()) {
+            if (result.isEmpty()) {
                 // If it can't find the lookup node, don't fail, just log that it couldn't be found
                 // ---
                 logger.debug("WARNING - Could not find lookup node that corresponds to nodeType ["
index bade2cd..76da9d8 100644 (file)
@@ -204,7 +204,7 @@ public class CQ2GremlinTest extends RESTAPI {
     protected void addStartNode(GraphTraversal<Vertex, Vertex> g, CustomQueryTestDTO content) {
         Optional<LinkedHashMap<String, String>> startNodeVertex = content.getVerticesDtos().stream()
             .filter(map -> map.containsKey("start-node")).findFirst();
-        if (!startNodeVertex.isPresent()) {
+        if (startNodeVertex.isEmpty()) {
             throw new IllegalArgumentException("start-node was not specified");
         }
         startNodeVertex.get().forEach((k, v) -> {
index ebf49d7..ad5eb4e 100644 (file)
@@ -25,7 +25,6 @@ import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.Date;
 import java.util.Timer;
 import java.util.TimerTask;
@@ -56,7 +55,7 @@ public class LocalCQConfig extends CQConfig {
             String filepath =
                 storedQueriesLocation + AAIConstants.AAI_FILESEP + "stored-queries.json";
             logger.info("Using the Local stored queries");
-            Path path = Paths.get(filepath);
+            Path path = Path.of(filepath);
             String customQueryConfigJson = new String(Files.readAllBytes(path));
             queryConfig = new GetCustomQueryConfig(customQueryConfigJson);
 
@@ -72,7 +71,7 @@ public class LocalCQConfig extends CQConfig {
             protected void onChange(File file) {
                 try {
                     String filepath = storedQueriesLocation;
-                    Path path = Paths.get(filepath);
+                    Path path = Path.of(filepath);
                     String customQueryConfigJson = new String(Files.readAllBytes(path));
                     queryConfig = new GetCustomQueryConfig(customQueryConfigJson);
 
index 10bee2b..c291551 100644 (file)
@@ -22,7 +22,7 @@ package org.onap.aai.service;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.Base64;
 import java.util.HashMap;
 import java.util.Map;
@@ -53,7 +53,7 @@ public class AuthorizationService {
 
         String basicAuthFile = getBasicAuthFilePath();
 
-        try (Stream<String> stream = Files.lines(Paths.get(basicAuthFile))) {
+        try (Stream<String> stream = Files.lines(Path.of(basicAuthFile))) {
             stream.filter(line -> !line.startsWith("#")).forEach(str -> {
                 byte[] bytes = null;
 
index e3351ae..9b88c38 100644 (file)
@@ -29,7 +29,6 @@ import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
@@ -101,7 +100,7 @@ public class SearchGraphNamedQueryTest extends AAISetup {
         assert files != null;
         for (File file : files) {
             try {
-                Path path = Paths.get(widgetPath + AAIConstants.AAI_FILESEP + file.getName());
+                Path path = Path.of(widgetPath + AAIConstants.AAI_FILESEP + file.getName());
                 String widgetPayload = new String(Files.readAllBytes(path));
                 String modelInvariantId = getJsonValue(widgetPayload, "model-invariant-id");
                 String widgetUri =
@@ -126,7 +125,7 @@ public class SearchGraphNamedQueryTest extends AAISetup {
         assert files != null;
         for (File file : files) {
             try {
-                Path path = Paths.get(namedQueryPath + AAIConstants.AAI_FILESEP + file.getName());
+                Path path = Path.of(namedQueryPath + AAIConstants.AAI_FILESEP + file.getName());
                 String namedQueryPayload = new String(Files.readAllBytes(path));
                 String namedQueryUuid = getJsonValue(namedQueryPayload, "named-query-uuid");
                 String namedQueryUri =
diff --git a/pom.xml b/pom.xml
index 0af26d2..6ab1d77 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.14.7</version>
+        <version>1.15.0-SNAPSHOT</version>
     </parent>
     <groupId>org.onap.aai.traversal</groupId>
     <artifactId>traversal</artifactId>
-    <version>1.14.7-SNAPSHOT</version>
+    <version>1.15.0-SNAPSHOT</version>
     <name>aai-traversal</name>
     <packaging>pom</packaging>
     <modules>
         <module>aai-traversal</module>
     </modules>
     <properties>
+        <maven.compiler.release>11</maven.compiler.release>
         <!--
             Nexus Proxy Properties and Snapshot Locations
             Ideally this can be overwritten at runtime per internal environment specific values at runtime
         -->
-        <aai.common.version>1.14.7</aai.common.version>
+        <aai.common.version>1.15.0-SNAPSHOT</aai.common.version>
         <nexusproxy>https://nexus.onap.org</nexusproxy>
         <site.path>/content/sites/site/org/onap/aai/traversal/${project.artifactId}/${project.version}</site.path>
         <release.path>/content/repositories/releases/</release.path>
index e8f490e..039d36d 100644 (file)
@@ -4,8 +4,8 @@
 # because they are used in Jenkins, whose plug-in doesn't support
 
 major_version=1
-minor_version=14
-patch_version=7
+minor_version=15
+patch_version=0
 
 base_version=${major_version}.${minor_version}.${patch_version}