aboutsummaryrefslogtreecommitdiffstats
path: root/search-data-service-app
diff options
context:
space:
mode:
Diffstat (limited to 'search-data-service-app')
-rw-r--r--search-data-service-app/pom.xml93
-rw-r--r--search-data-service-app/src/main/bin/start.sh7
-rw-r--r--search-data-service-app/src/main/docker/Dockerfile11
3 files changed, 105 insertions, 6 deletions
diff --git a/search-data-service-app/pom.xml b/search-data-service-app/pom.xml
index 0cf8043..a7099b1 100644
--- a/search-data-service-app/pom.xml
+++ b/search-data-service-app/pom.xml
@@ -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>
@@ -66,26 +68,29 @@
</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>
@@ -131,6 +136,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
+ <version>2.7.8</version>
</dependency>
<dependency>
@@ -215,11 +221,13 @@
<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>
@@ -406,6 +414,7 @@
<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>
@@ -425,6 +434,7 @@
</dependency>
</dependencies>
</plugin>
+
<!-- This plugin is used to generate Java POJO's from json format schema
file. -->
<plugin>
@@ -446,6 +456,44 @@
</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>
@@ -472,6 +520,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -482,6 +533,7 @@
<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. -->
@@ -494,6 +546,7 @@
<!-- 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
@@ -564,12 +617,25 @@
</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>
@@ -578,6 +644,31 @@
</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>
diff --git a/search-data-service-app/src/main/bin/start.sh b/search-data-service-app/src/main/bin/start.sh
index 7f81ee9..ec7788d 100644
--- a/search-data-service-app/src/main/bin/start.sh
+++ b/search-data-service-app/src/main/bin/start.sh
@@ -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
diff --git a/search-data-service-app/src/main/docker/Dockerfile b/search-data-service-app/src/main/docker/Dockerfile
index d5cda35..5284e5b 100644
--- a/search-data-service-app/src/main/docker/Dockerfile
+++ b/search-data-service-app/src/main/docker/Dockerfile
@@ -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