Update AAI Search-data-service from AEE develop branch to ONAP master 23/100023/3
authorPhillip Leigh <phillip.leigh@amdocs.com>
Mon, 6 Jan 2020 15:48:47 +0000 (10:48 -0500)
committerPhillip Leigh <phillip.leigh@amdocs.com>
Wed, 8 Jan 2020 15:20:31 +0000 (10:20 -0500)
Issue-ID: AAI-2741
Signed-off-by: Phillip Leigh <phillip.leigh@amdocs.com>
Change-Id: I93c8c8c224884340d65ad00bfc5d61b2196b0a71

pom.xml
search-data-service-app/pom.xml
search-data-service-app/src/main/bin/start.sh
search-data-service-app/src/main/docker/Dockerfile

diff --git a/pom.xml b/pom.xml
index ed2455e..41ea623 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,8 +3,8 @@
     ============LICENSE_START=======================================================
     org.onap.aai
     ================================================================================
-    Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
-    Copyright © 2017-2018 Amdocs
+    Copyright Â© 2017-2018 AT&T Intellectual Property. All rights reserved.
+    Copyright Â© 2017-2018 Amdocs
     ================================================================================
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -84,6 +84,7 @@
               <artifactId>maven-deploy-plugin</artifactId>
             </plugin>
         </plugins>
+
     </build>
 
     <distributionManagement>
     </distributionManagement>
 
 </project>
+
index 0cf8043..a7099b1 100644 (file)
@@ -37,6 +37,8 @@
 
     <properties>
         <docker.image.name.suffix>search-data-service</docker.image.name.suffix>
+        <docker.location>${basedir}/../target</docker.location>
+        <nexusproxy>https://nexus.onap.org</nexusproxy>
         <java.version>1.8</java.version>
         <generatedSourceDir>${basedir}/src/main/java-gen</generatedSourceDir>
         <checkstyle.config.location>google_checks.xml</checkstyle.config.location>
     </dependencyManagement>
 
     <dependencies>
-
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
+            <version>2.8.2</version>
         </dependency>
 
         <dependency>
             <groupId>org.hamcrest</groupId>
             <artifactId>hamcrest-library</artifactId>
+            <version>1.3</version>
             <scope>test</scope>
         </dependency>
 
         <dependency>
             <groupId>com.jayway.jsonpath</groupId>
             <artifactId>json-path</artifactId>
+            <version>2.2.0</version>
         </dependency>
 
         <dependency>
             <groupId>com.googlecode.json-simple</groupId>
             <artifactId>json-simple</artifactId>
+            <version>1.1.1</version>
         </dependency>
 
         <dependency>
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
+            <version>2.7.8</version>
         </dependency>
 
         <dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
+            <version>1.2.1</version>
         </dependency>
 
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-core</artifactId>
+            <version>1.2.1</version>
         </dependency>
 
     </dependencies>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
                 <configuration>
                     <compilerId>groovy-eclipse-compiler</compilerId>
                     <verbose>true</verbose>
                     </dependency>
                 </dependencies>
             </plugin>
+
             <!-- This plugin is used to generate Java POJO's from json format schema
                 file. -->
             <plugin>
                 </executions>
             </plugin>
 
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.7</version>
+                <executions>
+                    <execution>
+                        <id>copy-docker-file</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${basedir}/../target</outputDirectory>
+                            <overwrite>true</overwrite>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/src/main/docker</directory>
+                                    <filtering>true</filtering>
+                                    <includes>
+                                        <include>**/*</include>
+                                    </includes>
+                                </resource>
+                                <resource>
+                                    <directory>${basedir}</directory>
+                                    <filtering>true</filtering>
+                                    <includes>
+                                        <include>bundleconfig-local/**</include>
+                                    </includes>
+                                </resource>
+                                <resource>
+                                    <directory>${basedir}/src/main/bin/</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
             <!-- license plugin -->
             <plugin>
                 <groupId>com.mycila</groupId>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
             </plugin>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
             <plugin>
                 <groupId>org.jacoco</groupId>
                 <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.7.7.201606060606</version>
                 <executions>
                     <!-- Prepares the property pointing to the JaCoCo runtime agent which
                          is passed as VM argument when Maven the Surefire plugin is executed. -->
                             <!-- Sets the path to the file which contains the execution data. -->
                             <destFile>${sonar.jacoco.reportPath}</destFile>
                             <propertyName>surefireArgLine</propertyName>
+                            <dumpOnExit>true</dumpOnExit>
                         </configuration>
                     </execution>
                     <!-- Ensures that the code coverage report for unit tests is created
                             </rules>
                         </configuration>
                     </execution>
+
+                    <execution>
+                        <id>jacoco-initialize-unit-tests</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                        <configuration>
+                            <destFile>${project.build.directory}/coverage-reports/jacoco.exec
+                            </destFile>
+                            <!-- <append>true</append> -->
+                        </configuration>
+                    </execution>
                 </executions>
             </plugin>
             <!-- This plugin adds the generated sources directory to the clean lifecycle
                 so that automatically generated code will get cleaned up properly. -->
             <plugin>
                 <artifactId>maven-clean-plugin</artifactId>
+                <version>3.0.0</version>
                 <configuration>
                     <filesets>
                         <fileset>
                     </filesets>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>3.0.2</version>
+                <executions>
+                    <execution>
+                        <id>copy-files-on-build</id>
+                        <phase>install</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${basedir}/../target</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/target</directory>
+                                       <include>*.jar</include>
+                                    <filtering>false</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
         </plugins>
     </build>
     <distributionManagement>
index 7f81ee9..ec7788d 100644 (file)
@@ -14,6 +14,7 @@ if [ -z "$KEY_STORE_PASSWORD" ]; then
        exit 1
 fi
 
+
 # Changes related to:AAI-2179
 # Change aai search-data  container processes to run as non-root on the host
 USER_ID=${LOCAL_USER_ID:-9001}
@@ -32,13 +33,14 @@ if [ $(cat /etc/passwd | grep aaiadmin | wc -l) -eq 0 ]; then
         }
 fi;
 
+chmod -R 0755 ${MICRO_HOME} 
 chown -R aaiadmin:aaiadmin ${MICRO_HOME}
 chown -R aaiadmin:aaiadmin ${AJSC_HOME}
 chown -R aaiadmin:aaiadmin ${SD_LOGS}
 
 find ${MICRO_HOME}  -name "*.sh" -exec chmod +x {} +
 
-gosu aaiadmin ln -s /logs $MICRO_HOME/logs
+gosu aaiadmin ln -snf /logs $MICRO_HOME/logs
 JAVA_CMD="exec gosu aaiadmin java";
 ###
 PROPS="-DAJSC_HOME=$AJSC_HOME"
@@ -56,5 +58,6 @@ if [ ! -z "$TRUST_STORE_LOCATION" ]; then
 fi
 
 JVM_MAX_HEAP=${MAX_HEAP:-1024}
+JVM_MIN_HEAP=${JVM_MAX_HEAP}
 
-${JAVA_CMD}   $PROPS -jar $BASEDIR/search-data-service-package.jar
+${JAVA_CMD} -Xms${JVM_MIN_HEAP}m -Xmx${JVM_MAX_HEAP}m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/onap $PROPS -jar $BASEDIR/search-data-service-app.jar
index d5cda35..5284e5b 100644 (file)
@@ -33,9 +33,14 @@ fi
 # Build up the deployment folder structure
 RUN mkdir -p $MICRO_HOME $USERS_HOME /logs
 WORKDIR $MICRO_HOME
-COPY /maven/@project.artifactId@/ .
-RUN chmod 755 $BIN_HOME/* \
-    && ln -snf /logs $MICRO_HOME/logs
+RUN mkdir -p $MICRO_HOME/bundleconfig/etc
+ADD search-data-service* $MICRO_HOME/
+RUN mkdir -p $BIN_HOME
+COPY *.sh $BIN_HOME
+COPY bundleconfig-local $MICRO_HOME/bundleconfig
+COPY bundleconfig-local/etc/logback.xml $MICRO_HOME/bundleconfig/etc
+RUN chmod -R 755 $BIN_HOME/* $MICRO_HOME/*
+RUN ln -snf /logs $MICRO_HOME/logs
 
 EXPOSE 9509 9509