Adjust spring annotations 68/141268/1
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Sun, 15 Jun 2025 09:42:47 +0000 (11:42 +0200)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Sun, 15 Jun 2025 09:47:51 +0000 (11:47 +0200)
- remove ComponentScan and Configuration annotations from
  spring boot main class
- declare RestTemplate in separate RestClientConfiguration class
- build RestTemplate from dependency injected RestTemplateBuilder
  to support trace context propagation (when tracing is later added)
- bump snapshot version to 1.13.0-SNAPSHOT

Issue-ID: SO-4172
Change-Id: I9b3cbccb4b04773558ea3f39bc8930f59c0f8ac6
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
14 files changed:
packages/docker/pom.xml
packages/pom.xml
pom.xml
so-cnf-adapter-application/pom.xml
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/MSOCnfApplication.java
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/RestClientConfiguration.java [new file with mode: 0644]
so-cnfm/pom.xml
so-cnfm/so-cnfm-lcm/pom.xml
so-cnfm/so-cnfm-lcm/so-cnfm-lcm-api/pom.xml
so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/pom.xml
so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/pom.xml
so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/pom.xml
so-cnfm/so-cnfm-lcm/so-cnfm-lcm-service/pom.xml
version.properties

index 1bfade4..b638d93 100755 (executable)
@@ -4,10 +4,10 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
         <artifactId>packages</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
     <groupId>org.onap.so.adapters.so-cnf-adapter.packages</groupId>
-    <version>1.12.1-SNAPSHOT</version>
+    <version>1.13.0-SNAPSHOT</version>
     <packaging>pom</packaging>
     <artifactId>docker</artifactId>
     <name>Docker Packaging</name>
index d78cf28..7969a86 100644 (file)
@@ -4,11 +4,11 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
         <artifactId>so-cnf-adapter</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
     <artifactId>packages</artifactId>
     <packaging>pom</packaging>
-    <version>1.12.1-SNAPSHOT</version>
+    <version>1.13.0-SNAPSHOT</version>
     <name>Packages</name>
 
     <profiles>
diff --git a/pom.xml b/pom.xml
index c325fa0..0cd05fd 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
     </parent>
     <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
     <artifactId>so-cnf-adapter</artifactId>
-    <version>1.12.1-SNAPSHOT</version>
+    <version>1.13.0-SNAPSHOT</version>
     <name>SO CNF Adapter</name>
     <packaging>pom</packaging>
 
index b745c59..b82a62f 100755 (executable)
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
         <artifactId>so-cnf-adapter</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
   <artifactId>so-cnf-adapter-application</artifactId>
-  <version>1.12.1-SNAPSHOT</version>
+  <version>1.13.0-SNAPSHOT</version>
   <name>SO CNF Application Jar</name>
   <build>
     <finalName>${project.artifactId}-${project.version}</finalName>
index a437b9d..5984192 100644 (file)
@@ -28,25 +28,14 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerA
 import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration;
 import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
 import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.client.RestTemplate;
 
 @SpringBootApplication
-@ComponentScan(basePackages = {"org.onap.so.adapters.cnf", "org.onap.so.spring"})
 @EnableAutoConfiguration(exclude = {LiquibaseAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
         DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class,
         SecurityAutoConfiguration.class})
-@Configuration
 public class MSOCnfApplication {
 
     public static void main(String... args) {
         SpringApplication.run(MSOCnfApplication.class, args);
     }
-
-    @Bean
-    public RestTemplate restTemplate() {
-        return new RestTemplate();
-    }
 }
diff --git a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/RestClientConfiguration.java b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/RestClientConfiguration.java
new file mode 100644 (file)
index 0000000..b8ffbd6
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2025 Deutsche Telekom. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.adapters.cnf;
+
+import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+@Configuration
+public class RestClientConfiguration {
+
+  @Bean
+  RestTemplate restTemplate(RestTemplateBuilder builder) {
+    return builder.build();
+  }
+}
index 0ba6c9f..7abfb00 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
         <artifactId>so-cnf-adapter</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
     <artifactId>so-cnfm</artifactId>
     <packaging>pom</packaging>
index 2cf7667..316b8e3 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
         <artifactId>so-cnfm</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.onap.so.adapters.so-cnf-adapter.so-cnfm.lcm</groupId>
index 04075bc..38147c2 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter.so-cnfm.lcm</groupId>
         <artifactId>so-cnfm-lcm</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>so-cnfm-lcm-api</artifactId>
index 86a97f0..14fed45 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter.so-cnfm.lcm</groupId>
         <artifactId>so-cnfm-lcm</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>so-cnfm-lcm-application</artifactId>
index d183161..447577e 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter.so-cnfm.lcm</groupId>
         <artifactId>so-cnfm-lcm</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>so-cnfm-lcm-bpmn-flows</artifactId>
index afa923b..f5ee660 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter.so-cnfm.lcm</groupId>
         <artifactId>so-cnfm-lcm</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>so-cnfm-lcm-database-service</artifactId>
index a683ef6..7b6cbef 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.onap.so.adapters.so-cnf-adapter.so-cnfm.lcm</groupId>
         <artifactId>so-cnfm-lcm</artifactId>
-        <version>1.12.1-SNAPSHOT</version>
+        <version>1.13.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>so-cnfm-lcm-service</artifactId>
index 0e7c66e..362b4c7 100644 (file)
@@ -3,8 +3,8 @@
 # because they are used in Jenkins, whose plug-in doesn't support..
 
 major=1
-minor=12
-patch=3
+minor=13
+patch=0
 
 base_version=${major}.${minor}.${patch}