Updating ONAP A1PMS version & Change to OpenAPI-first
[nonrtric/plt/a1policymanagementservice.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index da6b1ec..ba524d1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,8 @@
 * ========================LICENSE_START=================================
 * O-RAN-SC
 * %%
-* Copyright (C) 2019-2023 Nordix Foundation
+* Copyright (C) 2019-2023: Nordix Foundation
+* Copyright (C) 2023-2024: OpenInfra Foundation Europe
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>3.0.4</version>
+        <version>3.2.5</version>
         <relativePath />
     </parent>
     <groupId>org.o-ran-sc.nonrtric.plt</groupId>
     <artifactId>a1policymanagementservice</artifactId>
-    <version>2.6.0-SNAPSHOT</version>
+    <version>2.8.0-SNAPSHOT</version>
     <licenses>
         <license>
             <name>The Apache Software License, Version 2.0</name>
     </repositories>
     <properties>
         <java.version>17</java.version>
-        <json.version>20220924</json.version>
+        <software.amazon.awssdk.version>2.19.17</software.amazon.awssdk.version>
+        <json.version>20231013</json.version>
+        <commons-io.version>2.14.0</commons-io.version>
+        <guava.version>32.0.1-jre</guava.version>
+        <surefire-maven-plugin.version>3.0.0-M8</surefire-maven-plugin.version>
+        <surefire-report-plugin.version>3.0.0-M8</surefire-report-plugin.version>
         <maven-compiler-plugin.version>3.10.0</maven-compiler-plugin.version>
-        <formatter-maven-plugin.version>2.13.0</formatter-maven-plugin.version>
-        <spotless-maven-plugin.version>2.30.0</spotless-maven-plugin.version>
-        <docker-maven-plugin>0.30.0</docker-maven-plugin>
-        <javax.ws.rs-api.version>2.1.1</javax.ws.rs-api.version>
+        <docker-maven-plugin>0.43.0</docker-maven-plugin>
         <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
         <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
         <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
-        <software.amazon.awssdk.version>2.19.17</software.amazon.awssdk.version>
-        <springdoc.version>2.0.2</springdoc.version>
-        <springdoc.openapi-ui.version>1.6.14</springdoc.openapi-ui.version>
     </properties>
     <dependencies>
         <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.11.0</version>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+            <version>2.0.1.Final</version>
         </dependency>
         <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>31.1-jre</version>
+            <groupId>javax.annotation</groupId>
+            <artifactId>javax.annotation-api</artifactId>
+            <version>1.3.2</version>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
+            <groupId>io.swagger.core.v3</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>2.2.15</version>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+            <groupId>org.openapitools</groupId>
+            <artifactId>jackson-databind-nullable</artifactId>
+            <version>0.2.4</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-webflux</artifactId>
+            <artifactId>spring-boot</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-            <optional>true</optional>
+            <artifactId>spring-boot-autoconfigure</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-validation</artifactId>
+            <artifactId>spring-boot-starter-webflux</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-webflux</artifactId>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjweaver</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat.embed</groupId>
+            <artifactId>tomcat-embed-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${guava.version}</version>
         </dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>json</artifactId>
             <version>${json.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-configuration-processor</artifactId>
-            <optional>true</optional>
-        </dependency>
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
             <scope>provided</scope>
         </dependency>
+        <!-- Actuator dependencies -->
         <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>javax.ws.rs-api</artifactId>
-            <version>${javax.ws.rs-api.version}</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+            <scope>runtime</scope>
         </dependency>
         <dependency>
-            <groupId>org.glassfish.jersey.inject</groupId>
-            <artifactId>jersey-hk2</artifactId>
+            <groupId>io.micrometer</groupId>
+            <artifactId>micrometer-registry-prometheus</artifactId>
         </dependency>
-        <!-- Actuator dependencies -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-actuator</artifactId>
+            <artifactId>spring-boot-starter-aop</artifactId>
         </dependency>
-        <!--REQUIRED
-        TO GENERATE DOCUMENTATION -->
         <dependency>
-            <groupId>org.springdoc</groupId>
-            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
-            <version>${springdoc.version}</version>
+            <groupId>software.amazon.awssdk</groupId>
+            <artifactId>s3</artifactId>
+            <version>${software.amazon.awssdk.version}</version>
         </dependency>
+        <!-- For development help -->
         <dependency>
-            <groupId>org.springdoc</groupId>
-            <artifactId>springdoc-openapi-ui</artifactId>
-            <version>${springdoc.openapi-ui.version}</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+            <scope>runtime</scope>
         </dependency>
-        <!-- TEST -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
             <artifactId>mockwebserver</artifactId>
             <scope>test</scope>
         </dependency>
-        <!-- https://mvnrepository.com/artifact/com.github.erosb/everit-json-schema -->
         <dependency>
-            <groupId>com.github.erosb</groupId>
-            <artifactId>everit-json-schema</artifactId>
-            <version>1.14.1</version>
-        </dependency>
-        <dependency>
-            <groupId>software.amazon.awssdk</groupId>
-            <artifactId>s3</artifactId>
-            <version>${software.amazon.awssdk.version}</version>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>${commons-io.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>io.micrometer</groupId>
-            <artifactId>micrometer-registry-prometheus</artifactId>
+            <groupId>com.github.erosb</groupId>
+            <artifactId>everit-json-schema</artifactId>
+            <version>1.14.0</version>
         </dependency>
     </dependencies>
     <build>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
+                <version>${surefire-maven-plugin.version}</version>
                 <configuration>
                     <skipTests>false</skipTests>
                 </configuration>
                 <artifactId>build-helper-maven-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>add-source</id>
+                        <id>add-additional-source-dirs</id>
                         <phase>generate-sources</phase>
                         <goals>
                             <goal>add-source</goal>
                         <configuration>
                             <sources>
                                 <source>${project.build.directory}/generated-sources/annotations/</source>
+                                <source>${project.basedir}/add-src/main/java</source>
+                                <source>${project.basedir}/add-src/main/resources</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>add-additional-testsource-dirs</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-test-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>${project.basedir}/add-src/test/java</source>
+                                <source>${project.basedir}/add-src/test/resources</source>
                             </sources>
                         </configuration>
                     </execution>
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>io.swagger.codegen.v3</groupId>
+                <artifactId>swagger-codegen-maven-plugin</artifactId>
+                <version>3.0.46</version>
+                <executions>
+                    <execution>
+                        <id>generate-openapi-json</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <inputSpec>${project.basedir}/api/pms-api.yaml</inputSpec>
+                            <language>openapi</language>
+                            <output>${project.basedir}/api</output>
+                            <configOptions>
+                                <outputFile>pms-api.json</outputFile>
+                            </configOptions>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.openapitools</groupId>
+                <artifactId>openapi-generator-maven-plugin</artifactId>
+                <version>6.6.0</version>
+                <executions>
+                    <execution>
+                        <id>generate-openapi-policy-api</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <generatorName>spring</generatorName>
+                            <inputSpec>${project.basedir}/api/pms-api.yaml</inputSpec>
+                            <library>spring-boot</library>
+                            <invokerPackage>org.onap.ccsdk.oran.a1policymanagementservice.controllers.v2</invokerPackage>
+                            <apiPackage>org.onap.ccsdk.oran.a1policymanagementservice.controllers.api.v2</apiPackage>
+                            <modelPackage>org.onap.ccsdk.oran.a1policymanagementservice.models.v2</modelPackage>
+                            <generateApiTests>false</generateApiTests>
+                            <generateModelTests>false</generateModelTests>
+                            <generateSupportingFiles>false</generateSupportingFiles>
+                            <skipValidateSpec>false</skipValidateSpec>
+                            <configOptions>
+                                <interfaceOnly>true</interfaceOnly>
+                                <useTags>true</useTags>
+                                <reactive>true</reactive>
+                                <dateLibrary>java8</dateLibrary>
+                                <java8>true</java8>
+                                <unhandledException>true</unhandledException>
+                                <openApiNullable>false</openApiNullable>
+                                <skipDefaultInterface>true</skipDefaultInterface>
+                            </configOptions>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>generate-openapi-html</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <inputSpec>${project.basedir}/api/pms-api.json</inputSpec>
+                            <generatorName>html2</generatorName>
+                            <output>${project.basedir}/api/pms-api</output>
+                            <skipOperationExample>false</skipOperationExample>
+                            <strictSpec>false</strictSpec>
+                            <configOptions>
+                                <appDescription>The O-RAN Non-RT RIC A1 Policy Management Service
+                                    provides a REST API for managing O-RAN A1 Policies.</appDescription>
+                                <appName>ONAP CCSDK A1 Policy Management Service</appName>
+                                <infoUrl>https://wiki.onap.org/display/DW/O-RAN+A1+Policies+in+ONAP</infoUrl>
+                                <licenseInfo>Copyright (C) 2020-2023 Nordix Foundation. Licensed
+                                    under the Apache License, and Copyright (C) 2024 OpenInfra 
+                                    Foundation Europe. All rights reserved.</licenseInfo>
+                                <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
+                            </configOptions>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resource-configuration-files</id>
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <overwrite>true</overwrite>
+                            <verbose>true</verbose>
+                            <outputDirectory>${project.basedir}/config</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${project.basedir}/onap/oran/a1-policy-management/config</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>copy-resource-openapi-files-fromsubmodule</id>
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <verbose>true</verbose>
+                            <overwrite>true</overwrite>
+                            <outputDirectory>${project.basedir}/api</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${project.basedir}/onap/oran/a1-policy-management/api</directory>
+                                    <includes>
+                                        <include>pms-api.json</include>
+                                        <include>pms-api.yaml</include>
+                                    </includes>
+                                    </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>copy-resource-doc-openapi</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.basedir}/docs/offeredapis/swagger</outputDirectory>
+                            <overwrite>true</overwrite>
+                            <verbose>true</verbose>
+                            <resources>
+                                <resource>
+                                    <directory>${project.basedir}/api</directory>
+                                    <includes>
+                                        <include>pms-api.json</include>
+                                        <include>pms-api.yaml</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>copy-resource-openapi-html</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <verbose>true</verbose>
+                            <outputDirectory>
+                                ${project.basedir}/docs/offeredapis/openapitoolgen/offeredapis/pms-api</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${project.basedir}/api/pms-api</directory>
+                                    <includes>
+                                        <include>index.html</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>io.fabric8</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
                                         <cleanup>try</cleanup>
                                         <contextDir>${basedir}</contextDir>
                                         <dockerFile>Dockerfile</dockerFile>
+                                        <filter>false</filter>
                                         <args>
                                             <JAR>${project.build.finalName}.jar</JAR>
                                         </args>
                                     <build>
                                         <contextDir>${basedir}</contextDir>
                                         <dockerFile>Dockerfile</dockerFile>
+                                        <filter>false</filter>
                                         <args>
                                             <JAR>${project.build.finalName}.jar</JAR>
                                         </args>
                 <executions>
                     <execution>
                         <id>git submodule update</id>
-                        <phase>initialize</phase>
+                        <phase>validate</phase>
                         <configuration>
                             <executable>git</executable>
                             <arguments>
                             <goal>exec</goal>
                         </goals>
                     </execution>
-                    <execution>
-                        <id>copy configuration</id>
-                        <phase>initialize</phase>
-                        <configuration>
-                            <executable>cp</executable>
-                            <arguments>
-                                <argument>-r</argument>
-                                <argument>onap/oran/a1-policy-management/config</argument>
-                                <argument>.</argument>
-                            </arguments>
-                        </configuration>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                    </execution>
                 </executions>
             </plugin>
         </plugins>
         <system>JIRA</system>
         <url>https://jira.o-ran-sc.org/</url>
     </issueManagement>
-</project>
\ No newline at end of file
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-report-plugin</artifactId>
+                <version>${surefire-report-plugin.version}</version>
+            </plugin>
+        </plugins>
+    </reporting>
+</project>