From b08767ed33915b9199f07cc9bca94b346e752196 Mon Sep 17 00:00:00 2001 From: Rishi Chail Date: Mon, 21 Sep 2020 11:27:32 +0100 Subject: DP: Project Structure and basic conf Issue-ID: CCSDK-2749 https: //jira.onap.org/browse/CCSDK-2749 Signed-off-by: Rishi Chail Change-Id: Ib2139263be435414855e2f487e96c2122f21c978 Signed-off-by: Rishi Chail --- cps/.gitignore | 2 ++ cps/cps-rest/pom.xml | 6 ---- .../src/main/java/org/onap/cps/Application.java | 32 ++++++++++++++++++++++ .../main/java/org/onap/cps/rest/Application.java | 32 ---------------------- cps/cps-rest/src/main/resources/application.yml | 9 ++++++ cps/cps-rest/src/main/resources/logback-spring.xml | 2 +- cps/cps-ri/pom.xml | 12 ++++++++ cps/cps-ri/src/main/resources/application.yml | 8 ------ cps/cps-ri/src/main/resources/logback-spring.xml | 2 +- .../src/main/resources/logback-spring.xml | 2 +- 10 files changed, 58 insertions(+), 49 deletions(-) create mode 100644 cps/cps-rest/src/main/java/org/onap/cps/Application.java delete mode 100644 cps/cps-rest/src/main/java/org/onap/cps/rest/Application.java delete mode 100644 cps/cps-ri/src/main/resources/application.yml diff --git a/cps/.gitignore b/cps/.gitignore index ba64fc2fdf..624c9b63b9 100644 --- a/cps/.gitignore +++ b/cps/.gitignore @@ -1,6 +1,8 @@ *.class *.jar *.war +*.zip +*.log target/ log/ diff --git a/cps/cps-rest/pom.xml b/cps/cps-rest/pom.xml index 41b5c42f32..0e8317b622 100644 --- a/cps/cps-rest/pom.xml +++ b/cps/cps-rest/pom.xml @@ -21,12 +21,6 @@ org.onap.cps cps-ri ${project.version} - - - org.springframework.boot - spring-boot-starter-data-jpa - - diff --git a/cps/cps-rest/src/main/java/org/onap/cps/Application.java b/cps/cps-rest/src/main/java/org/onap/cps/Application.java new file mode 100644 index 0000000000..9f6c2edce9 --- /dev/null +++ b/cps/cps-rest/src/main/java/org/onap/cps/Application.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2020 Nordix Foundation. 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.cps; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} \ No newline at end of file diff --git a/cps/cps-rest/src/main/java/org/onap/cps/rest/Application.java b/cps/cps-rest/src/main/java/org/onap/cps/rest/Application.java deleted file mode 100644 index 3183efc653..0000000000 --- a/cps/cps-rest/src/main/java/org/onap/cps/rest/Application.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2020 Nordix Foundation. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.cps.rest; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } -} \ No newline at end of file diff --git a/cps/cps-rest/src/main/resources/application.yml b/cps/cps-rest/src/main/resources/application.yml index ab19fe9aba..bc726694c7 100644 --- a/cps/cps-rest/src/main/resources/application.yml +++ b/cps/cps-rest/src/main/resources/application.yml @@ -4,6 +4,15 @@ server: spring: main: banner-mode: "off" + # for POC only, later this should move to cpi-ri module + jpa: + hibernate: + ddl-auto: create + datasource: + url: jdbc:mariadb://${DB_HOST}:3306/${DB_NAME} + username: ${USERNAME} + password: ${PWD} + driverClassName: org.mariadb.jdbc.Driver logging: level: diff --git a/cps/cps-rest/src/main/resources/logback-spring.xml b/cps/cps-rest/src/main/resources/logback-spring.xml index fce0aca2c4..8a4ae07c5b 100644 --- a/cps/cps-rest/src/main/resources/logback-spring.xml +++ b/cps/cps-rest/src/main/resources/logback-spring.xml @@ -19,7 +19,7 @@ ../log/${logName}.log - ${debugLogName}.%d{yyyy-MM-dd}.%i.log.zip + ${logName}.%d{yyyy-MM-dd}.%i.log.zip ${maxFileSize} ${maxHistory} diff --git a/cps/cps-ri/pom.xml b/cps/cps-ri/pom.xml index 3d0ccf0af3..0d6dcace4a 100644 --- a/cps/cps-ri/pom.xml +++ b/cps/cps-ri/pom.xml @@ -11,6 +11,13 @@ + + org.onap.cps + cps-service + ${project.version} + compile + + org.springframework.boot spring-boot-starter-data-jpa @@ -21,6 +28,11 @@ spring-boot-starter-validation + + org.mariadb.jdbc + mariadb-java-client + + org.projectlombok lombok diff --git a/cps/cps-ri/src/main/resources/application.yml b/cps/cps-ri/src/main/resources/application.yml deleted file mode 100644 index fc6883346e..0000000000 --- a/cps/cps-ri/src/main/resources/application.yml +++ /dev/null @@ -1,8 +0,0 @@ -spring: - jpa: - hibernate: - ddl-auto: create - datasource: - url: jdbc:mariadb://${DB_HOST}:3306/${DB_NAME} - username: ${USERNAME} - password: ${PWD} \ No newline at end of file diff --git a/cps/cps-ri/src/main/resources/logback-spring.xml b/cps/cps-ri/src/main/resources/logback-spring.xml index fce0aca2c4..8a4ae07c5b 100644 --- a/cps/cps-ri/src/main/resources/logback-spring.xml +++ b/cps/cps-ri/src/main/resources/logback-spring.xml @@ -19,7 +19,7 @@ ../log/${logName}.log - ${debugLogName}.%d{yyyy-MM-dd}.%i.log.zip + ${logName}.%d{yyyy-MM-dd}.%i.log.zip ${maxFileSize} ${maxHistory} diff --git a/cps/cps-service/src/main/resources/logback-spring.xml b/cps/cps-service/src/main/resources/logback-spring.xml index fce0aca2c4..8a4ae07c5b 100644 --- a/cps/cps-service/src/main/resources/logback-spring.xml +++ b/cps/cps-service/src/main/resources/logback-spring.xml @@ -19,7 +19,7 @@ ../log/${logName}.log - ${debugLogName}.%d{yyyy-MM-dd}.%i.log.zip + ${logName}.%d{yyyy-MM-dd}.%i.log.zip ${maxFileSize} ${maxHistory} -- cgit 1.2.3-korg