mso-cnf-adapter changes for docker tag name 11/118611/1
authormukesh.paliwal <mukesh.paliwal1@huawei.com>
Fri, 26 Feb 2021 15:46:00 +0000 (21:16 +0530)
committermukesh.paliwal <mukesh.paliwal1@huawei.com>
Fri, 26 Feb 2021 15:46:00 +0000 (21:16 +0530)
Issue-ID: SO-3518

Signed-off-by: mukesh.paliwal <mukesh.paliwal1@huawei.com>
Change-Id: I7a89e5b5f22cf7562b6a47dc41d4efdd1f2d647c

44 files changed:
packages/docker/pom.xml [new file with mode: 0755]
packages/docker/src/main/docker/docker-files/Dockerfile.so-app [moved from Dockerfile with 77% similarity, mode: 0644]
packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image [new file with mode: 0644]
packages/docker/src/main/docker/docker-files/ca-certificates/onap-ca.crt [moved from ca-certificates/onap-ca.crt with 100% similarity]
packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml [moved from configs/logging/logback-spring.xml with 94% similarity]
packages/docker/src/main/docker/docker-files/scripts/start-app.sh [new file with mode: 0755]
packages/docker/src/main/docker/docker-files/scripts/wait-for.sh [moved from scripts/wait-for.sh with 100% similarity]
packages/pom.xml [new file with mode: 0644]
pom.xml
scripts/.gitattributes [deleted file]
scripts/start-app.sh [deleted file]
so-cnf-adapter-application/pom.xml [new file with mode: 0755]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/MSOCnfApplication.java [moved from src/main/java/org/onap/so/adapters/cnf/MSOCnfApplication.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/WebSecurityConfig.java [moved from src/main/java/org/onap/so/adapters/cnf/WebSecurityConfig.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java [moved from src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java [moved from src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/Config.java [moved from src/main/java/org/onap/so/adapters/cnf/model/Config.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/ConfigTemplateEntity.java [moved from src/main/java/org/onap/so/adapters/cnf/model/ConfigTemplateEntity.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/ConfigurationEntity.java [moved from src/main/java/org/onap/so/adapters/cnf/model/ConfigurationEntity.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/ConfigurationRollbackEntity.java [moved from src/main/java/org/onap/so/adapters/cnf/model/ConfigurationRollbackEntity.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/ConnectivityInfo.java [moved from src/main/java/org/onap/so/adapters/cnf/model/ConnectivityInfo.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/ConnectivityRecords.java [moved from src/main/java/org/onap/so/adapters/cnf/model/ConnectivityRecords.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java [moved from src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/GroupVersionKind.java [moved from src/main/java/org/onap/so/adapters/cnf/model/GroupVersionKind.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/InstanceMiniResponse.java [moved from src/main/java/org/onap/so/adapters/cnf/model/InstanceMiniResponse.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/InstanceMiniResponseList.java [moved from src/main/java/org/onap/so/adapters/cnf/model/InstanceMiniResponseList.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/InstanceResponse.java [moved from src/main/java/org/onap/so/adapters/cnf/model/InstanceResponse.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/InstanceStatusResponse.java [moved from src/main/java/org/onap/so/adapters/cnf/model/InstanceStatusResponse.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java [moved from src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/OtherConnectivityListEntity.java [moved from src/main/java/org/onap/so/adapters/cnf/model/OtherConnectivityListEntity.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/PodStatus.java [moved from src/main/java/org/onap/so/adapters/cnf/model/PodStatus.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/ProfileEntity.java [moved from src/main/java/org/onap/so/adapters/cnf/model/ProfileEntity.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/Resource.java [moved from src/main/java/org/onap/so/adapters/cnf/model/Resource.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/ResourceBundleEntity.java [moved from src/main/java/org/onap/so/adapters/cnf/model/ResourceBundleEntity.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/Response.java [moved from src/main/java/org/onap/so/adapters/cnf/model/Response.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/Tag.java [moved from src/main/java/org/onap/so/adapters/cnf/model/Tag.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java [moved from src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/service/CnfAdapterService.java [moved from src/main/java/org/onap/so/adapters/cnf/service/CnfAdapterService.java with 100% similarity]
so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java [moved from src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java with 100% similarity]
so-cnf-adapter-application/src/main/resources/META-INF/services/org.onap.so.client.RestProperties [moved from src/main/resources/META-INF/services/org.onap.so.client.RestProperties with 100% similarity]
so-cnf-adapter-application/src/main/resources/application.yaml [moved from src/main/resources/application.yaml with 100% similarity]
so-cnf-adapter-application/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java [moved from src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java with 100% similarity]
so-cnf-adapter-application/src/test/java/org/onap/so/adapters/cnf/rest/CnfAdapterRestTest.java [moved from src/test/java/org/onap/so/adapters/cnf/rest/CnfAdapterRestTest.java with 100% similarity]
so-cnf-adapter-application/src/test/java/org/onap/so/adapters/cnf/service/CnfAdapterServiceTest.java [moved from src/test/java/org/onap/so/adapters/cnf/service/CnfAdapterServiceTest.java with 100% similarity]

diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml
new file mode 100755 (executable)
index 0000000..bf91ebf
--- /dev/null
@@ -0,0 +1,156 @@
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
+        <artifactId>so-cnf-adapter</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+    </parent>
+    <groupId>org.onap.so.adapters.so-cnf-adapter.packages</groupId>
+    <packaging>pom</packaging>
+    <artifactId>docker</artifactId>
+    <name>SO CNF Adapter Docker Packaging</name>
+
+    <properties>
+        <cnf-adapter-project-version>${project.version}</cnf-adapter-project-version>
+        <docker.skip>false</docker.skip>
+        <docker.skip.build>false</docker.skip.build>
+        <docker.skip.push>false</docker.skip.push>
+        <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
+        <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
+        <docker.image.prefix>onap/so</docker.image.prefix>
+        <docker.push.phase>deploy</docker.push.phase>
+    </properties>
+
+    <build>
+        <finalName>${project.artifactId}-${project.version}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.groovy.maven</groupId>
+                <artifactId>gmaven-plugin</artifactId>
+                <version>1.0</version>
+                <executions>
+                    <execution>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <configuration>
+                            <source>
+                                println 'Project version: ' + project.properties['cnf-adapter-project-version'];
+                                def versionArray;
+                                if (project.properties['cnf-adapter-project-version'] != null) {
+                                    versionArray = project.properties['cnf-adapter-project-version'].split('-');
+                                }
+
+                                if (project.properties['cnf-adapter-project-version'].endsWith("-SNAPSHOT")) {
+                                    project.properties['project.docker.latesttag.version'] = versionArray[0] + "-SNAPSHOT-latest";
+                                } else {
+                                    project.properties['project.docker.latesttag.version'] = versionArray[0] + "-STAGING-latest";
+                                }
+
+                                println 'New tag for docker: ' + project.properties['project.docker.latesttag.version'];
+                            </source>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>io.fabric8</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <configuration combine.self="override">
+                    <verbose>true</verbose>
+                    <apiVersion>1.23</apiVersion>
+                    <pullRegistry>${docker.pull.registry}</pullRegistry>
+                    <pushRegistry>${docker.push.registry}</pushRegistry>
+                    <images>
+                        <image>
+                            <name>${docker.image.prefix}/base-image:1.0</name>
+                            <build>
+                                <cleanup>try</cleanup>
+                                <dockerFile>docker-files/Dockerfile.so-base-image</dockerFile>
+                            </build>
+                        </image>
+                        <image>
+                            <name>so-cnf-adapter</name>
+                            <build>
+                                <cleanup>try</cleanup>
+                                <dockerFile>docker-files/Dockerfile.so-app</dockerFile>
+                                <tags>
+                                    <tag>${project.version}</tag>
+                                    <tag>${project.version}-${maven.build.timestamp}</tag>
+                                    <tag>${project.docker.latesttag.version}</tag>
+                                </tags>
+                                <assembly>
+                                    <inline>
+                                        <dependencySets>
+                                            <dependencySet>
+                                                <includes>
+                                                    <include>
+                                                        org.onap.so.adapters.so-cnf-adapter:so-cnf-adapter-application
+                                                    </include>
+                                                </includes>
+                                                <outputFileNameMapping>app.jar</outputFileNameMapping>
+                                            </dependencySet>
+                                        </dependencySets>
+                                    </inline>
+                                </assembly>
+                            </build>
+                        </image>
+
+                    </images>
+                </configuration>
+
+                <executions>
+                    <execution>
+                        <id>clean-images</id>
+                        <phase>pre-clean</phase>
+                        <goals>
+                            <goal>remove</goal>
+                        </goals>
+                        <configuration>
+                            <removeAll>true</removeAll>
+                        </configuration>
+                    </execution>
+
+                    <execution>
+                        <id>generate-images</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>build</goal>
+                        </goals>
+                    </execution>
+
+                    <execution>
+                        <id>push-images</id>
+                        <phase>${docker.push.phase}</phase>
+                        <goals>
+                            <goal>build</goal>
+                            <goal>push</goal>
+                        </goals>
+                        <configuration>
+                            <image>so-cnf-adapter</image>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
+            <artifactId>so-cnf-adapter-application</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
similarity index 77%
rename from Dockerfile
rename to packages/docker/src/main/docker/docker-files/Dockerfile.so-app
index 483c219..dc86ff8
@@ -1,30 +1,31 @@
-FROM adoptopenjdk/openjdk11:jre-11.0.8_10-alpine
+FROM onap/so/base-image:1.0
 
-ARG JAR_FILE=*.jar
 ARG http_proxy
 ENV HTTP_PROXY=$http_proxy
 ENV http_proxy=$HTTP_PROXY
 ARG https_proxy
 ENV HTTPS_PROXY=$https_proxy
 ENV https_proxy=$HTTPS_PROXY
+
 USER root
 RUN mkdir -p /app/config
 RUN mkdir -p /app/certificates
 RUN mkdir -p /app/logs
 RUN mkdir -p /app/ca-certificates
-RUN apk update && apk add apache2-utils
-COPY target/${JAR_FILE} /app/app.jar
 
+COPY maven/app.jar /app
 COPY configs/logging/logback-spring.xml /app
 COPY scripts/start-app.sh /app
 COPY scripts/wait-for.sh /app
 COPY ca-certificates/onap-ca.crt /app/ca-certificates/onap-ca.crt
-#RUN chown -R so:so /app
-#USER so
+RUN chown -R so:so /app
+
+USER so
 # Springboot configuration (required)
 VOLUME /app/config
+
 #  Root certificates (optional)
 VOLUME /app/ca-certificates
+
 WORKDIR /app
 ENTRYPOINT ["/app/start-app.sh"]
-
diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image b/packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image
new file mode 100644 (file)
index 0000000..a1f4fc1
--- /dev/null
@@ -0,0 +1,19 @@
+FROM adoptopenjdk/openjdk11:jre-11.0.8_10-alpine
+
+ARG http_proxy
+ARG https_proxy
+ENV HTTP_PROXY=$http_proxy
+ENV HTTPS_PROXY=$https_proxy
+ENV http_proxy=$HTTP_PROXY
+ENV https_proxy=$HTTPS_PROXY
+
+# Install commonly needed tools
+RUN apk --no-cache add curl netcat-openbsd nss apache2-utils java-cacerts
+
+# Create symlink for default Java truststore
+RUN set -eux; \
+    rm -rf "$JAVA_HOME/lib/security/cacerts"; \
+    ln -sT /etc/ssl/certs/java/cacerts "$JAVA_HOME/lib/security/cacerts"
+
+# Create 'so' user
+RUN addgroup -g 1000 so && adduser -S -u 1000 -G so -s /bin/sh so
@@ -1,22 +1,22 @@
 <!--
   ============LICENSE_START=======================================================
-  ONAP - SO
-  ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+   Copyright (C) 2021 Nordix Foundation.
   ================================================================================
   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=========================================================
--->
+ -->
 <configuration scan="true" debug="false">
     <contextListener class="org.onap.so.logger.LoggerStartupListener" />
     <include resource="org/springframework/boot/logging/logback/defaults.xml" />
     <logger name="org.springframework" level="WARN" />
     <logger name="org.springframework.security.authentication.dao.DaoAuthenticationProvider" level="DEBUG" />
 
-    <!-- Camunda related loggers -->
-    <logger name="org.camunda.bpm.engine.jobexecutor.level" level="WARN" />
-    <logger name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity.level" level="WARN" />
-
     <logger name="org.apache.wire" level="DEBUG" />
     <logger name="org.onap" level="DEBUG" />
-    <logger name="com.att.ecomp" level="DEBUG" />
+    
     <logger name="org.apache.cxf.interceptor" level="DEBUG" />
-    <logger name="com.att.commons" level="DEBUG" />
+    
     <logger name="org.reflections" level="ERROR" />
 
     <logger name="AUDIT" level="INFO" additivity="false">
diff --git a/packages/docker/src/main/docker/docker-files/scripts/start-app.sh b/packages/docker/src/main/docker/docker-files/scripts/start-app.sh
new file mode 100755 (executable)
index 0000000..618d55f
--- /dev/null
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+if [ `id -u` = 0 ]
+then
+    # Install certificates found in the /app/ca-certificates volume, if any.
+
+    needUpdate=FALSE
+
+    for certificate in `ls -1 /app/ca-certificates`; do
+        echo "Installing $certificate in /usr/local/share/ca-certificates"
+        cp /app/ca-certificates/$certificate /usr/local/share/ca-certificates/$certificate
+        needUpdate=TRUE
+    done
+
+    if [ $needUpdate = TRUE ]; then
+        update-ca-certificates --fresh
+    fi
+
+    # Re-exec this script as the 'onap' user.
+    this=`readlink -f $0`
+    exec su so -c  "$this"
+fi
+
+touch /app/app.jar
+
+if [ ! -z "$DB_HOST" -a -z "$DB_PORT" ]; then
+    export DB_PORT=3306
+fi
+
+if [ -z "${CONFIG_PATH}" ]; then
+    export CONFIG_PATH=/app/config/override.yaml
+fi
+
+if [ -z "${LOG_PATH}" ]; then
+    export LOG_PATH="logs/${APP}"
+fi
+
+if [ "${SSL_DEBUG}" = "log" ]; then
+    export SSL_DEBUG="-Djavax.net.debug=all"
+else
+    export SSL_DEBUG=
+fi
+
+# Set java keystore and truststore options, if specified in the environment.
+
+jksargs=
+
+if [ ! -z "${KEYSTORE}" ]; then
+    jksargs="$jksargs -Dmso.load.ssl.client.keystore=true"
+    jksargs="$jksargs -Djavax.net.ssl.keyStore=$KEYSTORE"
+    jksargs="$jksargs -Djavax.net.ssl.keyStorePassword=${KEYSTORE_PASSWORD}"
+fi
+
+if [ ! -z "${TRUSTSTORE}" ]; then
+    jksargs="$jksargs -Djavax.net.ssl.trustStore=${TRUSTSTORE}"
+    jksargs="$jksargs -Djavax.net.ssl.trustStorePassword=${TRUSTSTORE_PASSWORD}"
+fi
+
+if [ -z "${ACTIVE_PROFILE}" ]; then
+    export ACTIVE_PROFILE="basic"
+fi
+
+jvmargs="${JVM_ARGS} -Dspring.profiles.active=${ACTIVE_PROFILE} -Djava.security.egd=file:/dev/./urandom -Dlogs_dir=${LOG_PATH} -Dlogging.config=/app/logback-spring.xml $jksargs -Dspring.config.additional-location=$CONFIG_PATH ${SSL_DEBUG} ${DISABLE_SNI}"
+
+
+read_properties(){
+    while IFS="=" read -r key value; do
+        case "${key}" in
+          '#'*) ;;
+             *)
+               eKey=$(echo $key | tr '[:lower:]' '[:upper:]')
+               export "$eKey"="$value"
+        esac
+    done <<-EOF
+       $1
+       EOF
+}
+
+if [ -n "${AAF_SSL_CERTS_ENABLED}" ]; then
+read_properties "$(head -n 4 /app/certs/.passphrases)"
+fi
+
+echo "JVM Arguments: ${jvmargs}"
+
+java ${jvmargs} -jar app.jar
+rc=$?
+
+echo "Application exiting with status code $rc"
+
+if [ ! -z "${EXIT_DELAY}" -a "${EXIT_DELAY}" != 0 ]; then
+    echo "Delaying $APP exit for $EXIT_DELAY seconds"
+    sleep $EXIT_DELAY
+fi
+
+exit $rc
\ No newline at end of file
diff --git a/packages/pom.xml b/packages/pom.xml
new file mode 100644 (file)
index 0000000..5c94fcf
--- /dev/null
@@ -0,0 +1,34 @@
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
+        <artifactId>so-cnf-adapter</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>packages</artifactId>
+    <packaging>pom</packaging>
+    <name>SO CNF Adapter Packages</name>
+
+    <profiles>
+        <!-- DO NOT CHANGE THE *ORDER* IN WHICH THESE PROFILES ARE DEFINED! -->
+
+        <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+        </profile>
+
+        <!-- Those profile are exclusive, choose docker or with-integration-tests -->
+        <profile>
+            <id>docker</id>
+            <modules>
+                <module>docker</module>
+            </modules>
+            <properties>
+                <docker.skip.push>false</docker.skip.push>
+            </properties>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index c1250f4..7d7848e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
-<!--
-  ~*
-  ~============LICENSE_START=======================================================
-  ~* ONAP - SO
-  ~*================================================================================
-  ~* Copyright (C) 2020 Huawei Technologies Co., Ltd. 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=========================================================
-  ~*/
-  -->
-
 <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.so</groupId>
-    <artifactId>so</artifactId>
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.so</groupId>
+        <artifactId>so</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+    </parent>
+    <groupId>org.onap.so.adapters.so-cnf-adapter</groupId>
+    <artifactId>so-cnf-adapter</artifactId>
     <version>1.8.0-SNAPSHOT</version>
-  </parent>
-  <!-- <groupId>org.onap.so.adapters</groupId -->
-  <artifactId>so-cnf-adapter</artifactId>
-  <packaging>jar</packaging>
-  <name>so-cnf-adapter</name>
-  <description>Web service endpoint for cnf operations</description>
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-dependencies</artifactId>
-        <version>${springboot.version}</version>
-        <type>pom</type>
-        <scope>import</scope>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-  <build>
-    <finalName>${project.artifactId}-${project.version}</finalName>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-deploy-plugin</artifactId>
-        <configuration>
-            <skip>true</skip>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-maven-plugin</artifactId>
-        <configuration>
-          <mainClass>org.onap.so.adapters.cnf.MSOCnfApplication</mainClass>
-        </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>repackage</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.jacoco</groupId>
-        <artifactId>jacoco-maven-plugin</artifactId>
-      </plugin>
-      <plugin>
-        <groupId>net.revelc.code.formatter</groupId>
-        <artifactId>formatter-maven-plugin</artifactId>
-        <version>2.9.0</version>
-        <executions>
-          <execution>
-            <id>format-java</id>
-            <goals>
-              <goal>format</goal>
-            </goals>
-            <phase>process-sources</phase>
-            <configuration>
-              <skip>${format.skipExecute}</skip>
-              <configFile>${project.basedir}/onap-eclipse-format.xml</configFile>
-            </configuration>
-          </execution>
-          <execution>
-            <id>format-xml</id>
-            <goals>
-              <goal>format</goal>
-            </goals>
-            <phase>process-sources</phase>
-            <configuration>
-              <skip>${format.skipExecute}</skip>
-              <sourceDirectory>${project.basedir}</sourceDirectory>
-              <configXmlFile>${project.basedir}/pom-format.properties</configXmlFile>
-              <includes>
-                <include>pom.xml</include>
-              </includes>
-            </configuration>
-          </execution>
-          <execution>
-            <id>validate-java</id>
-            <goals>
-              <goal>validate</goal>
-            </goals>
-            <configuration>
-              <skip>${format.skipValidate}</skip>
-              <configFile>${project.basedir}/onap-eclipse-format.xml</configFile>
-            </configuration>
-          </execution>
-          <execution>
-            <id>validate-poms</id>
-            <goals>
-              <goal>validate</goal>
-            </goals>
-            <configuration>
-              <skip>${format.skipValidate}</skip>
-              <configFile>${project.basedir}/pom-format.properties</configFile>
-              <includes>
-                <include>pom.xml</include>
-              </includes>
-            </configuration>
-          </execution>
-        </executions>
-        <dependencies>
-          <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
-            <version>2.9.8</version>
-          </dependency>
-        </dependencies>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>exec-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>docker-build</id>
-            <phase>install</phase>
-            <goals>
-              <goal>exec</goal>
-            </goals>
-            <configuration>
-              <dockerFile>Dockerfile</dockerFile>
-              <executable>docker</executable>
-              <workingDirectory>${project.basedir}</workingDirectory>
-              <arguments>
-                <argument>build</argument>
-                <argument>-t</argument>
-                <argument>${project.artifactId}:${project.version}</argument>
-                <argument>.</argument>
-              </arguments>
-              <buildArgs>
-                <JAR_FILE>${project.artifactId}-${project.version}.jar</JAR_FILE>
-                <ARTIFACT_ID>${project.artifactId}</ARTIFACT_ID>
-              </buildArgs>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot-starter-actuator</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot-starter-web</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot-starter-jdbc</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.tomcat</groupId>
-          <artifactId>tomcat-jdbc</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpmime</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot-starter-data-jpa</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot-starter-test</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpclient</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpcore</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.cloud</groupId>
-      <artifactId>spring-cloud-contract-wiremock</artifactId>
-      <version>1.2.4.RELEASE</version>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.so</groupId>
-      <artifactId>aai-client</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.xml.ws</groupId>
-      <artifactId>jaxws-ri</artifactId>
-      <version>2.3.0</version>
-      <type>pom</type>
-    </dependency>
-  </dependencies>
-</project>
+    <name>SO CNF Adapter</name>
+    <packaging>pom</packaging>
+    
+    <properties>
+        <java.version>11</java.version>
+        <version.java.compiler>11</version.java.compiler>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <version-swagger-codegen>2.3.1</version-swagger-codegen>
+        <gson-fire-version>1.8.2</gson-fire-version>
+        <retrofit-version>2.7.2</retrofit-version>
+        <threetenbp-version>1.3.5</threetenbp-version>
+        <oltu-version>1.0.1</oltu-version>
+        <swagger-core-version>1.5.21</swagger-core-version>
+        <okhttp3-version>3.14.0</okhttp3-version>
+        <okhttp-version>2.7.5</okhttp-version>
+        <okio-version>1.13.0</okio-version>
+        <spring-security-oauth2-version>2.3.6.RELEASE</spring-security-oauth2-version>
+        <jaxb-api>2.3.0</jaxb-api>
+        <snakeyaml-version>0.11</snakeyaml-version>
+        <hamcrest-version>2.2</hamcrest-version>
+        <equalsverifier-version>3.4.1</equalsverifier-version>
+        <so-core-version>1.8.0-SNAPSHOT</so-core-version>
+    </properties>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>${version.java.compiler}</source>
+                    <target>${version.java.compiler}</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>net.revelc.code.formatter</groupId>
+                <artifactId>formatter-maven-plugin</artifactId>
+                <version>2.9.0</version>
+                <executions>
+                    <execution>
+                        <id>format-java</id>
+                        <goals>
+                            <goal>format</goal>
+                        </goals>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <skip>true</skip>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>format-xml</id>
+                        <goals>
+                            <goal>format</goal>
+                        </goals>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <skip>true</skip>
+                            <includes>
+                                <include>pom.xml</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>validate-java</id>
+                        <goals>
+                            <goal>validate</goal>
+                        </goals>
+                        <configuration>
+                            <skip>true</skip>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>validate-poms</id>
+                        <goals>
+                            <goal>validate</goal>
+                        </goals>
+                        <configuration>
+                            <skip>true</skip>
+                            <includes>
+                                <include>pom.xml</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <modules>
+        <module>so-cnf-adapter-application</module>
+        <module>packages</module>
+    </modules>
+</project>
diff --git a/scripts/.gitattributes b/scripts/.gitattributes
deleted file mode 100644 (file)
index b905d1d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# Default behavior
-* text=auto
-
-# Files to have unix style line endings on checkout
-*.sh text eol=lf
\ No newline at end of file
diff --git a/scripts/start-app.sh b/scripts/start-app.sh
deleted file mode 100755 (executable)
index 54ed9ed..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-#temprary condition
-if [ `id -u` = 0 ]
-then
-       # Install certificates found in the /app/ca-certificates volume, if any.
-
-       needUpdate=FALSE
-
-       for certificate in `ls -1 /app/ca-certificates`; do
-               echo "Installing $certificate in /usr/local/share/ca-certificates"
-               # cp /app/ca-certificates/$certificate /usr/local/share/ca-certificates/$certificate
-               needUpdate=FALSE
-       done
-
-       # Re-exec this script as the 'onap' user.
-       this=`readlink -f $0`
-       # exec su so -c  "$this"
-fi
-
-touch /app/app.jar
-
-if [ ! -z "$DB_HOST" -a -z "$DB_PORT" ]; then
-       export DB_PORT=3306
-fi
-
-if [ -z "${CONFIG_PATH}" ]; then
-       export CONFIG_PATH=/app/config/override.yaml
-fi
-
-if [ "${SSL_DEBUG}" = "log" ]; then
-       export SSL_DEBUG="-Djavax.net.debug=all"
-else
-       export SSL_DEBUG=
-fi
-
-# Set java keystore and truststore options, if specified in the environment.
-
-jksargs=
-
-if [ ! -z "${KEYSTORE}" ]; then
-       jksargs="$jksargs -Dmso.load.ssl.client.keystore=true"
-       jksargs="$jksargs -Djavax.net.ssl.keyStore=$KEYSTORE"
-       jksargs="$jksargs -Djavax.net.ssl.keyStorePassword=${KEYSTORE_PASSWORD}"
-fi
-
-if [ ! -z "${TRUSTSTORE}" ]; then
-       jksargs="$jksargs -Djavax.net.ssl.trustStore=${TRUSTSTORE}"
-       jksargs="$jksargs -Djavax.net.ssl.trustStorePassword=${TRUSTSTORE_PASSWORD}"
-fi
-
-if [ -z "${ACTIVE_PROFILE}" ]; then
-       export ACTIVE_PROFILE="basic"
-fi
-
-jvmargs="${JVM_ARGS} -Dspring.profiles.active=${ACTIVE_PROFILE} -Djava.security.egd=file:/dev/./urandom -Dlogs_dir=${LOG_PATH} -Dlogging.config=/app/logback-spring.xml $jksargs -Dspring.config.additional-location=$CONFIG_PATH ${SSL_DEBUG} ${DISABLE_SNI}"
-
-
-read_properties(){
-    while IFS="=" read -r key value; do
-        case "${key}" in
-          '#'*) ;;
-             *)
-               eKey=$(echo $key | tr '[:lower:]' '[:upper:]')
-               export "$eKey"="$value"
-        esac
-    done <<-EOF
-       $1
-       EOF
-}
-
-
-
-if [ -n "${AAF_SSL_CERTS_ENABLED}" ]; then
-read_properties "$(head -n 4 /app/certs/.passphrases)"
-fi
-
-echo "JVM Arguments: ${jvmargs}"
-
-java ${jvmargs} -jar app.jar
-rc=$?
-
-echo "Application exiting with status code $rc"
-
-if [ ! -z "${EXIT_DELAY}" -a "${EXIT_DELAY}" != 0 ]; then
-       echo "Delaying $APP exit for $EXIT_DELAY seconds"
-       sleep $EXIT_DELAY
-fi
-
-exit $rc
diff --git a/so-cnf-adapter-application/pom.xml b/so-cnf-adapter-application/pom.xml
new file mode 100755 (executable)
index 0000000..ae6cf96
--- /dev/null
@@ -0,0 +1,182 @@
+<!--
+  ~*
+  ~============LICENSE_START=======================================================
+  ~* ONAP - SO
+  ~*================================================================================
+  ~* Copyright (C) 2020 Huawei Technologies Co., Ltd. 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=========================================================
+  ~*/
+  -->
+
+<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.so.adapters.so-cnf-adapter</groupId>
+        <artifactId>so-cnf-adapter</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+    </parent>
+  <artifactId>so-cnf-adapter-application</artifactId>
+  <name>so-cnf-adapter</name>
+  <packaging>jar</packaging>
+  <description>Web service endpoint for cnf operations</description>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-dependencies</artifactId>
+        <version>${springboot.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <build>
+    <finalName>${project.artifactId}-${project.version}</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <configuration>
+            <skip>true</skip>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+        <configuration>
+          <mainClass>org.onap.so.adapters.cnf.MSOCnfApplication</mainClass>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>repackage</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>original</id>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemPropertyVariables>
+                        <so.log.level>DEBUG</so.log.level>
+                    </systemPropertyVariables>
+                    <rerunFailingTestsCount>2</rerunFailingTestsCount>
+                    <parallel>suites</parallel>
+                    <useUnlimitedThreads>false</useUnlimitedThreads>
+                    <threadCount>1</threadCount>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+                <excludes>
+                    <exclude>**/*.p12</exclude>
+                    <exclude>**/*.jks</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>false</filtering>
+                <includes>
+                    <include>**/*.p12</include>
+                    <include>**/*.jks</include>
+                </includes>
+            </resource>
+        </resources>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-actuator</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-jdbc</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.tomcat</groupId>
+          <artifactId>tomcat-jdbc</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpmime</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-data-jpa</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpclient</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpcore</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-contract-wiremock</artifactId>
+      <version>1.2.4.RELEASE</version>
+    </dependency>
+    <dependency>
+      <groupId>org.onap.so</groupId>
+      <artifactId>aai-client</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.xml.ws</groupId>
+      <artifactId>jaxws-ri</artifactId>
+      <version>2.3.0</version>
+      <type>pom</type>
+    </dependency>
+  </dependencies>
+</project>
+