summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pom.xml22
-rw-r--r--src/main/bin/start.sh22
-rw-r--r--src/main/docker/Dockerfile19
3 files changed, 30 insertions, 33 deletions
diff --git a/pom.xml b/pom.xml
index 4f02dd0..68db642 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,7 +55,7 @@
<apache.commons-text.version>1.8</apache.commons-text.version>
<commons-compress.version>1.19</commons-compress.version>
<hamcrest-all.version>1.3</hamcrest-all.version>
- <babel.version>1.6.2</babel.version>
+ <babel.version>1.8.0</babel.version>
<aai.rest.client.version>1.2.1</aai.rest.client.version>
<sdc-distribution-client.version>1.4.1</sdc-distribution-client.version>
<logback.version>1.2.3</logback.version>
@@ -65,7 +65,7 @@
<aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/</aai.build.directory>
<aai.docker.namespace>onap</aai.docker.namespace>
<aai.base.image>alpine</aai.base.image>
- <aai.base.image.version>1.6.0</aai.base.image.version>
+ <aai.base.image.version>1.8.1</aai.base.image.version>
<!-- This will be used for the docker images as the default format of maven build has issues -->
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
@@ -82,6 +82,12 @@
<sonar.scanner.version>3.7.0.1746</sonar.scanner.version>
+ <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
+ <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
+ <maven-compiler-plugin.source>11</maven-compiler-plugin.source>
+ <maven-compiler-plugin.target>11</maven-compiler-plugin.target>
+ <maven-compiler-plugin.test.source>11</maven-compiler-plugin.test.source>
+ <maven-compiler-plugin.test.target>11</maven-compiler-plugin.test.target>
</properties>
<distributionManagement>
@@ -373,6 +379,18 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin.version}</version>
+ <inherited>true</inherited>
+ <configuration>
+ <source>${maven-compiler-plugin.source}</source>
+ <target>${maven-compiler-plugin.target}</target>
+ <testSource>${maven-compiler-plugin.test.source}</testSource>
+ <testTarget>${maven-compiler-plugin.test.target}</testTarget>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh
index 1dedb25..19d2717 100644
--- a/src/main/bin/start.sh
+++ b/src/main/bin/start.sh
@@ -20,13 +20,6 @@
# ============LICENSE_END============================================
#*******************************************************************************
-# jre-alpine image has $JAVA_HOME set and added to $PATH
-# ubuntu image requires to set $JAVA_HOME and add java to $PATH manually
-if ( uname -v | grep -i "ubuntu" ); then
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-`dpkg --print-architecture | awk -F- '{ print $NF }'`
- export PATH=${JAVA_HOME}:$PATH
-fi
-
# AJSC_HOME is required for EELF logging.
# This path is referenced in the file logback.xml.
AJSC_HOME="${AJSC_HOME-/opt/app/model-loader}"
@@ -37,6 +30,8 @@ if [ -z "$CONFIG_HOME" ]; then
exit 1
fi
+JARFILE=$(ls ./model-loader*.jar);
+
# Some properties are repeated here for debugging purposes.
PROPS="-DAJSC_HOME=$AJSC_HOME"
PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME"
@@ -46,18 +41,5 @@ PROPS="$PROPS -Dlogback.configurationFile=$AJSC_HOME/logback.xml"
PROPS="$PROPS -Dserver.port=9500"
JVM_MAX_HEAP=${MAX_HEAP:-1024}
-if [ -z "${java_runtime_arguments}" ]; then
- java_runtime_arguments="-Xms75m -Xmx${JVM_MAX_HEAP}m \
- -Dcom.sun.management.jmxremote \
- -Dcom.sun.management.jmxremote.authenticate=false \
- -Dcom.sun.management.jmxremote.ssl=false \
- -Dcom.sun.management.jmxremote.local.only=false \
- -Dcom.sun.management.jmxremote.port=1099 \
- -Dcom.sun.management.jmxremote.rmi.port=1099 \
- -Djava.rmi.server.hostname=127.0.0.1"
-fi
-
-JARFILE=$(ls ./model-loader*.jar);
-
echo "java $java_runtime_arguments $PROPS -jar $JARFILE"
java $java_runtime_arguments $PROPS -jar $JARFILE
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
index a4da9af..10bc3e6 100644
--- a/src/main/docker/Dockerfile
+++ b/src/main/docker/Dockerfile
@@ -2,20 +2,17 @@ FROM @aai.docker.namespace@/aai-common-@aai.base.image@:@aai.base.image.version@
ARG MICRO_HOME=/opt/app/model-loader
-# Build up the deployment folder structure
-RUN mkdir -p $MICRO_HOME $MICRO_HOME/logs
-
-RUN groupadd aaiadmin -g 1000
-RUN adduser -u 1000 -h /opt/aaihome/aaiadmin -S -D -G aaiadmin -s /bin/bash aaiadmin
WORKDIR $MICRO_HOME
-RUN chown -R aaiadmin:aaiadmin $MICRO_HOME $MICRO_HOME/logs
+USER root
-COPY --chown=aaiadmin:aaiadmin /maven/model-loader/ .
+RUN mkdir -p /opt/aaihome $MICRO_HOME /logs && \
+ ln -s /logs $MICRO_HOME/logs && \
+ chown -R aaiadmin:aaiadmin $MICRO_HOME && \
+ chown -R aaiadmin:aaiadmin /logs
-USER aaiadmin
+COPY --chown=aaiadmin:aaiadmin /maven/model-loader/ .
-RUN chmod 755 bin/* \
- && ln -s /logs $MICRO_HOME/logs
+ENTRYPOINT ["/bin/bash", "/opt/app/model-loader/bin/start.sh"]
-CMD ["/opt/app/model-loader/bin/start.sh"]
+USER aaiadmin