summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cps-application/pom.xml152
-rw-r--r--cps-application/src/main/java/org/onap/cps/Application.java (renamed from cps-rest/src/main/java/org/onap/cps/Application.java)0
-rw-r--r--cps-application/src/main/resources/application.yml (renamed from cps-rest/src/main/resources/application.yml)8
-rw-r--r--cps-bom/pom.xml17
-rwxr-xr-xcps-dependencies/pom.xml14
-rwxr-xr-xcps-nf-proxy-rest/pom.xml52
-rw-r--r--cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java30
-rw-r--r--[-rwxr-xr-x]cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java6
-rw-r--r--cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java2
-rw-r--r--cps-nf-proxy-rest/src/main/resources/application.yml46
-rw-r--r--cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy32
-rw-r--r--cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy2
-rwxr-xr-xcps-parent/pom.xml30
-rwxr-xr-xcps-rest/pom.xml64
-rwxr-xr-xcps-rest/src/main/java/org/onap/cps/config/CpsConfig.java7
-rw-r--r--cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java2
-rw-r--r--cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java2
-rw-r--r--cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy2
-rw-r--r--cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy2
-rw-r--r--docker-compose/README.md16
-rw-r--r--docker-compose/docker-compose.yml14
-rw-r--r--pom.xml1
22 files changed, 253 insertions, 248 deletions
diff --git a/cps-application/pom.xml b/cps-application/pom.xml
new file mode 100644
index 0000000000..a159ad883a
--- /dev/null
+++ b/cps-application/pom.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.cps</groupId>
+ <artifactId>cps-parent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../cps-parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>cps-application</artifactId>
+
+ <properties>
+ <minimum-coverage>0.0</minimum-coverage>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-starter-sleuth</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <id>build</id>
+ <goals>
+ <goal>dockerBuild</goal>
+ </goals>
+ </execution>
+ <execution>
+ <phase>deploy</phase>
+ <id>buildAndPush</id>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>cps-docker</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cps-rest</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>xnf-docker</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+
+ <properties>
+ <app>org.onap.cps.Application</app>
+ <repository.name>nexus3.onap.org:10001/onap/cps-nf-proxy</repository.name>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cps-nf-proxy-rest</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>cps-xnf-docker</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+
+ <properties>
+ <app>org.onap.cps.Application</app>
+ <repository.name>nexus3.onap.org:10001/onap/cps-and-nf-proxy</repository.name><!-- better naming? -->
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cps-rest</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cps-nf-proxy-rest</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project> \ No newline at end of file
diff --git a/cps-rest/src/main/java/org/onap/cps/Application.java b/cps-application/src/main/java/org/onap/cps/Application.java
index d8e849d53d..d8e849d53d 100644
--- a/cps-rest/src/main/java/org/onap/cps/Application.java
+++ b/cps-application/src/main/java/org/onap/cps/Application.java
diff --git a/cps-rest/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml
index 22948c3c30..c3ceecde0a 100644
--- a/cps-rest/src/main/resources/application.yml
+++ b/cps-application/src/main/resources/application.yml
@@ -3,12 +3,12 @@ server:
rest:
api:
- base-path: /cps/api
+ cps-base-path: /cps/api
+ xnf-base-path: /cps-nf-proxy/api
spring:
main:
banner-mode: "off"
-# for POC only, later this should move to cpi-ri module
jpa:
ddl-auto: create
open-in-view: false
@@ -34,8 +34,8 @@ management:
endpoints:
web:
base-path: /manage
- exposure:
- include: health,info,loggers
+ exposure:
+ include: info,health,loggers
endpoint:
health:
show-details: always
diff --git a/cps-bom/pom.xml b/cps-bom/pom.xml
index cc89de7aa8..3d43f6c5b8 100644
--- a/cps-bom/pom.xml
+++ b/cps-bom/pom.xml
@@ -33,32 +33,37 @@
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.onap.cps</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>cps-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.cps</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>cps-rest</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.cps</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>cps-nf-proxy-rest</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.cps</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>cps-ri</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.cps</groupId>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>cps-application</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>checkstyle</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.cps</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>spotbugs</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml
index 23683f65c2..1beee115b0 100755
--- a/cps-dependencies/pom.xml
+++ b/cps-dependencies/pom.xml
@@ -26,6 +26,7 @@
<spock-spring.version>1.3-groovy-2.5</spock-spring.version>
<spotbugs.version>4.2.0</spotbugs.version>
<springboot.version>2.3.8.RELEASE</springboot.version>
+ <springboot.cloud.version>Hoxton.SR9</springboot.cloud.version>
<springfox.version>3.0.0</springfox.version>
<swagger.version>2.1.4</swagger.version>
<testcontainers.version>1.15.1</testcontainers.version>
@@ -55,6 +56,13 @@
<scope>import</scope>
</dependency>
<dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-dependencies</artifactId>
+ <version>${springboot.cloud.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
<version>${yangtools.version}</version>
@@ -66,6 +74,12 @@
<artifactId>swagger-annotations</artifactId>
<version>${swagger.version}</version>
</dependency>
+ <!---To be removed once swagger-codegen-maven-plugin is upgraded-->
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.6.2</version>
+ </dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
diff --git a/cps-nf-proxy-rest/pom.xml b/cps-nf-proxy-rest/pom.xml
index 7b56014353..ca2cf83452 100755
--- a/cps-nf-proxy-rest/pom.xml
+++ b/cps-nf-proxy-rest/pom.xml
@@ -12,9 +12,7 @@
<artifactId>cps-nf-proxy-rest</artifactId>
<properties>
- <app>org.onap.cps.nfproxy.Application</app>
- <repository.name>nexus3.onap.org:10001/onap/cps-nf-proxy</repository.name>
- <minimum-coverage>0.44</minimum-coverage>
+ <minimum-coverage>0.0</minimum-coverage>
</properties>
<dependencies>
@@ -53,6 +51,10 @@
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
@@ -92,10 +94,6 @@
<build>
<plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
<!-- Swagger code generation. -->
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
@@ -112,44 +110,16 @@
<apiPackage>org.onap.cps.nfproxy.rest.api</apiPackage>
<language>spring</language>
<generateSupportingFiles>false</generateSupportingFiles>
+ <configOptions>
+ <sourceFolder>src/gen/java</sourceFolder>
+ <dateLibrary>java11</dateLibrary>
+ <interfaceOnly>true</interfaceOnly>
+ <useTags>true</useTags>
+ </configOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
-
- <profiles>
- <profile>
- <id>docker</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>com.google.cloud.tools</groupId>
- <artifactId>jib-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <id>build</id>
- <goals>
- <goal>dockerBuild</goal>
- </goals>
- </execution>
- <execution>
- <phase>deploy</phase>
- <id>buildAndPush</id>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
diff --git a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java
deleted file mode 100644
index abad806e0b..0000000000
--- a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/Application.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2021 Pantheon.tech
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.cps.nfproxy;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-@SpringBootApplication
-public class Application {
- public static void main(final String[] args) {
- SpringApplication.run(Application.class, args);
- }
-}
diff --git a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java
index 3bdedc3631..defe0f19c8 100755..100644
--- a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java
+++ b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/config/NfProxyConfig.java
@@ -33,9 +33,11 @@ public class NfProxyConfig {
/**
* Swagger-ui configuration.
*/
- @Bean
+ @Bean("nf-proxy-docket")
public Docket api() {
- return new Docket(DocumentationType.OAS_30).select()
+ return new Docket(DocumentationType.OAS_30)
+ .groupName("nf-proxy-docket")
+ .select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
diff --git a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java
index 8125c5aed7..99451e69a2 100644
--- a/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java
+++ b/cps-nf-proxy-rest/src/main/java/org/onap/cps/nfproxy/rest/controller/NfProxyController.java
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
-@RequestMapping("${rest.api.base-path}")
+@RequestMapping("${rest.api.xnf-base-path}")
public class NfProxyController implements NfProxyApi {
@Override
diff --git a/cps-nf-proxy-rest/src/main/resources/application.yml b/cps-nf-proxy-rest/src/main/resources/application.yml
deleted file mode 100644
index 06c0fd1ea3..0000000000
--- a/cps-nf-proxy-rest/src/main/resources/application.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-server:
- port: 8080
-
-rest:
- api:
- base-path: /cps-nf-proxy/api
-
-spring:
- main:
- banner-mode: "off"
-# for POC only, later this should move to cpi-ri module
- jpa:
- ddl-auto: create
- open-in-view: false
- properties:
- hibernate:
- enable_lazy_load_no_trans: true
- dialect: org.hibernate.dialect.PostgreSQLDialect
-
- datasource:
- url: jdbc:postgresql://${DB_HOST}:5432/cpsdb
- username: ${DB_USERNAME}
- password: ${DB_PASSWORD}
- driverClassName: org.postgresql.Driver
- initialization-mode: always
-
-# Actuator
-management:
- endpoints:
- web:
- base-path: /manage
- exposure:
- include: info,health,loggers
- endpoint:
- health:
- show-details: always
- # kubernetes probes: liveness and readiness
- probes:
- enabled: true
- loggers:
- enabled: true
-
-logging:
- level:
- org:
- springframework: INFO
diff --git a/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy b/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy
deleted file mode 100644
index 3eb42d7779..0000000000
--- a/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/config/NfProxyConfigSpec.groovy
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2021 Pantheon.tech
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-package org.onap.cps.nfproxy.config
-
-
-import spock.lang.Specification
-import springfox.documentation.spring.web.plugins.Docket
-
-class NfProxyConfigSpec extends Specification {
- def objectUnderTest = new NfProxyConfig()
-
- def 'xNF Proxy configuration has a Docket API'() {
- expect: 'the CPS configuration has a Docket API'
- objectUnderTest.api() instanceof Docket
- }
-}
diff --git a/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy b/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy
index d1c3b1648f..874a1b004e 100644
--- a/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy
+++ b/cps-nf-proxy-rest/src/test/groovy/org/onap/cps/nfproxy/rest/controller/NfProxyControllerSpec.groovy
@@ -33,7 +33,7 @@ class NfProxyControllerSpec extends Specification {
@Autowired
MockMvc mvc
- @Value('${rest.api.base-path}')
+ @Value('${rest.api.xnf-base-path}')
def basePath
def 'Hello world method invocation.'(){
diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml
index b8f8975a67..36abc909cc 100755
--- a/cps-parent/pom.xml
+++ b/cps-parent/pom.xml
@@ -33,7 +33,7 @@
<spotbugs.version>4.2.0</spotbugs.version>
<swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
<snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
- <tag.version>${project.version}</tag.version>
+ <image.version>${project.version}</image.version>
<jacoco.reportDirectory.aggregate>${project.reporting.outputDirectory}/jacoco-aggregate</jacoco.reportDirectory.aggregate>
<sonar.coverage.jacoco.xmlReportPaths>
@@ -45,6 +45,8 @@
../cps-rest/target/site/jacoco-aggregate/jacoco.xml,
../cps-nf-proxy-rest/target/site/jacoco-ut/jacoco.xml,
../cps-nf-proxy-rest/target/site/jacoco-aggregate/jacoco.xml,
+ ../cps-application/target/site/jacoco-ut/jacoco.xml,
+ ../cps-application/target/site/jacoco-aggregate/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
</properties>
@@ -120,27 +122,6 @@
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>${swagger-codegen-maven-plugin.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- <configuration>
- <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
- <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
- <modelPackage>org.onap.cps.rest.model</modelPackage>
- <apiPackage>org.onap.cps.rest.api</apiPackage>
- <language>spring</language>
- <generateSupportingFiles>false</generateSupportingFiles>
- <configOptions>
- <sourceFolder>src/gen/java</sourceFolder>
- <dateLibrary>java11</dateLibrary>
- <interfaceOnly>true</interfaceOnly>
- <useTags>true</useTags>
- </configOptions>
- </configuration>
- </execution>
- </executions>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
@@ -155,10 +136,7 @@
<image>${base.image}</image>
</from>
<to>
- <image>${repository.name}</image>
- <tags>
- <tag>${tag.version}</tag>
- </tags>
+ <image>${repository.name}:${image.version}</image>
</to>
</configuration>
</plugin>
diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml
index 49c3267dd9..6ee0c4fdd1 100755
--- a/cps-rest/pom.xml
+++ b/cps-rest/pom.xml
@@ -12,7 +12,7 @@
<artifactId>cps-rest</artifactId>
<properties>
- <minimum-coverage>0.88</minimum-coverage>
+ <minimum-coverage>0.53</minimum-coverage>
</properties>
<dependencies>
@@ -51,6 +51,10 @@
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
@@ -94,48 +98,32 @@
<build>
<plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
<!-- Swagger code generation. -->
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
+ <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
+ <modelPackage>org.onap.cps.rest.model</modelPackage>
+ <apiPackage>org.onap.cps.rest.api</apiPackage>
+ <language>spring</language>
+ <generateSupportingFiles>false</generateSupportingFiles>
+ <configOptions>
+ <sourceFolder>src/gen/java</sourceFolder>
+ <dateLibrary>java11</dateLibrary>
+ <interfaceOnly>true</interfaceOnly>
+ <useTags>true</useTags>
+ </configOptions>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
-
- <profiles>
- <profile>
- <id>docker</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>com.google.cloud.tools</groupId>
- <artifactId>jib-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <id>build</id>
- <goals>
- <goal>dockerBuild</goal>
- </goals>
- </execution>
- <execution>
- <phase>deploy</phase>
- <id>buildAndPush</id>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git a/cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java b/cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java
index cca5fe7d8d..419a218930 100755
--- a/cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java
+++ b/cps-rest/src/main/java/org/onap/cps/config/CpsConfig.java
@@ -34,9 +34,12 @@ public class CpsConfig {
/**
* Swagger configuration.
*/
- @Bean
+ @Bean("cps-docket")
public Docket api() {
- return new Docket(DocumentationType.OAS_30).select().apis(RequestHandlerSelectors.any())
+ return new Docket(DocumentationType.OAS_30)
+ .groupName("cps-docket")
+ .select()
+ .apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any()).build();
}
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java
index 1b6f56a211..8f4bdb716f 100644
--- a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java
+++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java
@@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
-@RequestMapping("${rest.api.base-path}")
+@RequestMapping("${rest.api.cps-base-path}")
public class AdminRestController implements CpsAdminApi {
@Autowired
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
index 2ecbd4f544..61f9399e7e 100644
--- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
+++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
@@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
-@RequestMapping("${rest.api.base-path}")
+@RequestMapping("${rest.api.cps-base-path}")
public class DataRestController implements CpsDataApi {
@Autowired
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
index 540d6224aa..88adf10efa 100644
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/AdminRestControllerSpec.groovy
@@ -61,7 +61,7 @@ class AdminRestControllerSpec extends Specification {
@Autowired
MockMvc mvc
- @Value('${rest.api.base-path}')
+ @Value('${rest.api.cps-base-path}')
def basePath
def anchorsEndpoint = '/v1/dataspaces/my_dataspace/anchors'
diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
index edc484b14a..45f6102a2f 100644
--- a/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
+++ b/cps-rest/src/test/groovy/org/onap/cps/rest/exceptions/CpsRestExceptionHandlerSpec.groovy
@@ -61,7 +61,7 @@ class CpsRestExceptionHandlerSpec extends Specification {
@Autowired
MockMvc mvc
- @Value('${rest.api.base-path}')
+ @Value('${rest.api.cps-base-path}')
def basePath
@Shared
diff --git a/docker-compose/README.md b/docker-compose/README.md
index 619b0d4a8d..ca395df07a 100644
--- a/docker-compose/README.md
+++ b/docker-compose/README.md
@@ -1,7 +1,19 @@
-# Docker Compose
+# Docker Compose deployment example for local enviroments, CPS deployment is done via OOM
To run the application locally using `docker-compose`, execute following command from this `docker-compose` folder:
+Generate the containers
+
+```bash
+mvn clean install -Pcps-docker -Pxnf-docker -Pcps-xnf-docker
+```
+or for generate an specific type
+
+```bash
+mvn clean install -Pcps-docker
+```
+Run the containers
+
```bash
-VERSION=0.0.1-SNAPSHOT DB_HOST=dbpostgresql DB_USERNAME=cps DB_PASSWORD=cps docker-compose up
+VERSION=0.0.1-SNAPSHOT DB_HOST=dbpostgresql DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d
``` \ No newline at end of file
diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml
index 391d91109e..accdbd4dbf 100644
--- a/docker-compose/docker-compose.yml
+++ b/docker-compose/docker-compose.yml
@@ -5,7 +5,7 @@ services:
container_name: cps-service
image: nexus3.onap.org:10001/onap/cps-service:${VERSION}
ports:
- - "8080:8080"
+ - "8881:8080"
environment:
DB_HOST: ${DB_HOST}
DB_USERNAME: ${DB_USERNAME}
@@ -14,18 +14,6 @@ services:
depends_on:
- dbpostgresql
- cps-nf-proxy:
- container_name: cps-nf-proxy
- image: nexus3.onap.org:10001/onap/cps-nf-proxy:${VERSION}
- ports:
- - "8081:8080"
- environment:
- DB_HOST: ${DB_HOST}
- DB_USERNAME: ${DB_USERNAME}
- DB_PASSWORD: ${DB_PASSWORD}
- restart: unless-stopped
- depends_on:
- - dbpostgresql
dbpostgresql:
container_name: dbpostgresql
diff --git a/pom.xml b/pom.xml
index eaa388cc1c..ab0a459f01 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,5 +36,6 @@
<module>cps-ri</module>
<module>checkstyle</module>
<module>spotbugs</module>
+ <module>cps-application</module>
</modules>
</project>