Fixed project version parsing 93/94193/3
authorDmitry Puzikov <dmitry.puzikov@tieto.com>
Thu, 22 Aug 2019 13:30:56 +0000 (15:30 +0200)
committerDmitry Puzikov <dmitry.puzikov@tieto.com>
Thu, 29 Aug 2019 14:50:06 +0000 (16:50 +0200)
Change-Id: I488b42b187e78db90e862ca8683bb361fa1d9bf6
Issue-ID: INT-1152
Signed-off-by: Dmitry Puzikov <dmitry.puzikov@tieto.com>
.gitignore
elasticsearch-sg/pom.xml
pom.xml
search-data-service-app/pom.xml
search-data-service-app/src/main/assembly/descriptor.xml [new file with mode: 0644]
search-data-service-app/src/main/docker/Dockerfile

index 79cde97..e6cb035 100644 (file)
@@ -1,5 +1,5 @@
 **/src/main/java-gen/
-/target/
+target/
 /bin/
 .project
 .settings/
@@ -7,3 +7,4 @@
 .idea/
 logs/
 debug-logs/
+*.iml
index 31bad6a..8b35a82 100644 (file)
 
 -->
 <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>
+         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>
-               <artifactId>search-data-service</artifactId>
-               <groupId>org.onap.aai</groupId>
-               <version>1.6.0-SNAPSHOT</version>
-       </parent>
+    <parent>
+        <artifactId>search-data-service</artifactId>
+        <groupId>org.onap.aai</groupId>
+        <version>1.6.0-SNAPSHOT</version>
+    </parent>
 
 
-       <groupId>org.onap.aai.search-data-service</groupId>
-       <artifactId>elasticsearch-sg</artifactId>
-       <name>ElasticSearch with SearchGuard</name>
-       <version>1.6.0-SNAPSHOT</version>
-       <packaging>pom</packaging>
+    <groupId>org.onap.aai.search-data-service</groupId>
+    <artifactId>elasticsearch-sg</artifactId>
+    <name>ElasticSearch with SearchGuard</name>
+    <version>1.6.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
 
-       <properties>
-               <nexusproxy>https://nexus.onap.org</nexusproxy>
-       </properties>
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>build-helper-maven-plugin</artifactId>
+                        <version>3.0.0</version>
+                    </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>process-resources</phase>
+                                <goals>
+                                    <goal>copy-resources</goal>
+                                </goals>
+                                <configuration>
+                                    <outputDirectory>${aai.build.directory}</outputDirectory>
+                                    <overwrite>true</overwrite>
+                                    <resources>
+                                        <resource>
+                                            <directory>${basedir}/src/main/docker</directory>
+                                            <includes>
+                                                <include>**/*</include>
+                                            </includes>
+                                        </resource>
+                                    </resources>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
 
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-resources-plugin</artifactId>
-                               <version>2.7</version>
-                               <executions>
-                                       <execution>
-                                               <id>copy-docker-file</id>
-                                               <phase>process-resources</phase>
-                                               <goals>
-                                                       <goal>copy-resources</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <outputDirectory>target</outputDirectory>
-                                                       <overwrite>true</overwrite>
-                                                       <resources>
-                                                               <resource>
-                                                                       <directory>${basedir}/src/main/docker</directory>
-                                                                       <includes>
-                                                                               <include>**/*</include>
-                                                                       </includes>
-                                                               </resource>
-                                                       </resources>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-
-                       <plugin>
-                               <groupId>com.spotify</groupId>
-                               <artifactId>docker-maven-plugin</artifactId>
-                               <version>0.4.11</version>
-                               <configuration>
-                                       <verbose>true</verbose>
-                                       <serverId>docker-hub</serverId>
-                                       <imageName>${docker.push.registry}/onap/${project.artifactId}</imageName>
-                                       <dockerDirectory>${basedir}/target</dockerDirectory>
-                                       <imageTags>
-                                               <imageTag>latest</imageTag>
-                                       </imageTags>
-                                       <forceTags>true</forceTags>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-deploy-plugin</artifactId>
-                       </plugin>
-               </plugins>
-       </build>
-
-       <distributionManagement>
-               <repository>
-                       <id>ecomp-releases</id>
-                       <name>ECOMP Release Repository</name>
-                       <url>${nexusproxy}/content/repositories/releases/</url>
-               </repository>
-               <snapshotRepository>
-                       <id>ecomp-snapshots</id>
-                       <name>ECOMP Snapshot Repository</name>
-                       <url>${nexusproxy}/content/repositories/snapshots/</url>
-               </snapshotRepository>
-       </distributionManagement>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <version>${docker.fabric.version}</version>
+                        <configuration>
+                            <verbose>true</verbose>
+                            <apiVersion>1.23</apiVersion>
+                            <images>
+                                <image>
+                                    <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l
+                                    </name>
+                                    <build>
+                                        <filter>@</filter>
+                                        <tags>
+                                            <tag>latest</tag>
+                                            <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
+                                            <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
+                                        </tags>
+                                        <cleanup>try</cleanup>
+                                        <dockerFileDir>${aai.build.directory}</dockerFileDir>
+                                    </build>
+                                </image>
+                            </images>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>clean-images</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>remove</goal>
+                                </goals>
+                                <configuration>
+                                    <removeAll>true</removeAll>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-images</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>build</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>push-images</id>
+                                <phase>deploy</phase>
+                                <goals>
+                                    <goal>push</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-deploy-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+    <distributionManagement>
+        <repository>
+            <id>ecomp-releases</id>
+            <name>ECOMP Release Repository</name>
+            <url>${nexusproxy}/content/repositories/releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>ecomp-snapshots</id>
+            <name>ECOMP Snapshot Repository</name>
+            <url>${nexusproxy}/content/repositories/snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
 
 </project>
diff --git a/pom.xml b/pom.xml
index 43b920a..abbd898 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 
        <properties>
                <nexusproxy>https://nexus.onap.org</nexusproxy>
+               <!-- docker related properties -->
+               <docker.fabric.version>0.31.0</docker.fabric.version>
+               <aai.docker.version>1.0.0</aai.docker.version>
+               <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.build.directory>${project.build.directory}/${project.artifactId}-build/</aai.build.directory>
+               <!-- 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>
        </properties>
 
+       <profiles>
+               <profile>
+                       <id>docker</id>
+                       <build>
+                               <pluginManagement>
+                                       <plugins>
+                                               <plugin>
+                                                       <groupId>org.codehaus.mojo</groupId>
+                                                       <artifactId>build-helper-maven-plugin</artifactId>
+                                                       <version>3.0.0</version>
+                                                       <executions>
+                                                               <execution>
+                                                                       <phase>pre-clean</phase>
+                                                                       <id>parse-version</id>
+                                                                       <goals>
+                                                                               <goal>parse-version</goal>
+                                                                       </goals>
+                                                               </execution>
+                                                       </executions>
+                                               </plugin>
+                                       </plugins>
+                               </pluginManagement>
+                       </build>
+               </profile>
+       </profiles>
+
        <build>
                <plugins>
-                       <plugin>
-                               <groupId>com.spotify</groupId>
-                               <artifactId>docker-maven-plugin</artifactId>
-                               <version>0.4.11</version>
-                               <configuration>
-                                       <skipDockerBuild>true</skipDockerBuild>
-                               </configuration>
-                       </plugin>
                        <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-deploy-plugin</artifactId>
index 9fd750c..0cf8043 100644 (file)
 
 -->
 <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>
-               <artifactId>search-data-service</artifactId>
-               <groupId>org.onap.aai</groupId>
-               <version>1.6.0-SNAPSHOT</version>
-       </parent>
-
-       <groupId>org.onap.aai.search-data-service</groupId>
-       <artifactId>search-data-service-app</artifactId>
-       <version>1.6.0-SNAPSHOT</version>
-       <name>AAI Search Data Service Application</name>
-
-       <properties>
-               <docker.location>${basedir}/target</docker.location>
-               <docker.image.name.suffix>search-data-service</docker.image.name.suffix>
-               <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>
-
-               <sonar.language>java</sonar.language>
-               <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
-               <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports
-               </sonar.surefire.reportsPath>
-               <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec
-               </sonar.jacoco.reportPath>
-               <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>
-               <sonar.projectVersion>${project.version}</sonar.projectVersion>
-               <jacoco.line.coverage.limit>0.58</jacoco.line.coverage.limit>
-               <spring.boot.version>1.5.21.RELEASE</spring.boot.version>
-       </properties>
-       
-       <dependencyManagement>
-          <dependencies>
+         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>
+        <artifactId>search-data-service</artifactId>
+        <groupId>org.onap.aai</groupId>
+        <version>1.6.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.onap.aai.search-data-service</groupId>
+    <artifactId>search-data-service-app</artifactId>
+    <version>1.6.0-SNAPSHOT</version>
+    <name>AAI Search Data Service Application</name>
+
+    <properties>
+        <docker.image.name.suffix>search-data-service</docker.image.name.suffix>
+        <java.version>1.8</java.version>
+        <generatedSourceDir>${basedir}/src/main/java-gen</generatedSourceDir>
+        <checkstyle.config.location>google_checks.xml</checkstyle.config.location>
+
+        <sonar.language>java</sonar.language>
+        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+        <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports
+        </sonar.surefire.reportsPath>
+        <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec
+        </sonar.jacoco.reportPath>
+        <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>
+        <sonar.projectVersion>${project.version}</sonar.projectVersion>
+        <jacoco.line.coverage.limit>0.58</jacoco.line.coverage.limit>
+        <spring.boot.version>1.5.21.RELEASE</spring.boot.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
             <dependency>
-              <groupId>org.springframework.boot</groupId>
-              <artifactId>spring-boot-starter-parent</artifactId>
-              <version>${spring.boot.version}</version>
-              <type>pom</type>
-              <scope>import</scope>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-parent</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
             </dependency>
-          </dependencies>
-       </dependencyManagement>
-       
-       <dependencies>
-
-               <dependency>
-                       <groupId>com.google.code.gson</groupId>
-                       <artifactId>gson</artifactId>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.hamcrest</groupId>
-                       <artifactId>hamcrest-library</artifactId>
-                       <scope>test</scope>
-               </dependency>
-
-               <dependency>
-                       <groupId>com.jayway.jsonpath</groupId>
-                       <artifactId>json-path</artifactId>
-               </dependency>
-
-               <dependency>
-                       <groupId>com.googlecode.json-simple</groupId>
-                       <artifactId>json-simple</artifactId>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.dom4j</groupId>
-                       <artifactId>dom4j</artifactId>
-                       <version>2.1.1</version>
-                       <scope>provided</scope>
-               </dependency>
-
-               <dependency>
-                       <groupId>commons-io</groupId>
-                       <artifactId>commons-io</artifactId>
-                       <version>2.4</version>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.mockito</groupId>
-                       <artifactId>mockito-all</artifactId>
-                       <version>1.10.19</version>
-                       <scope>test</scope>
-               </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest-library</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.jayway.jsonpath</groupId>
+            <artifactId>json-path</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.googlecode.json-simple</groupId>
+            <artifactId>json-simple</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>2.1.1</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.10.19</version>
+            <scope>test</scope>
+        </dependency>
 
         <!-- Common logging framework -->
-               <dependency>
-                       <groupId>org.onap.aai.logging-service</groupId>
-                       <artifactId>common-logging</artifactId>
-                       <version>1.5.0</version>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.onap.aai.logging-service</groupId>
-                       <artifactId>logging-api</artifactId>
-                       <version>1.5.0</version>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.onap.aai.logging-service</groupId>
-                       <artifactId>eelf-logging</artifactId>
-                       <version>1.5.0</version>
-               </dependency>
+        <dependency>
+            <groupId>org.onap.aai.logging-service</groupId>
+            <artifactId>common-logging</artifactId>
+            <version>1.5.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onap.aai.logging-service</groupId>
+            <artifactId>logging-api</artifactId>
+            <version>1.5.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onap.aai.logging-service</groupId>
+            <artifactId>eelf-logging</artifactId>
+            <version>1.5.0</version>
+        </dependency>
 
         <!-- For JSON Mapping Support. -->
-               <dependency>
-                       <groupId>com.fasterxml.jackson.core</groupId>
-                       <artifactId>jackson-databind</artifactId>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.apache.directory.studio</groupId>
-                       <artifactId>org.apache.commons.lang</artifactId>
-                       <version>2.6</version>
-               </dependency>
-
-               <dependency>
-                       <groupId>radeox</groupId>
-                       <artifactId>radeox</artifactId>
-                       <version>0.9</version>
-               </dependency>
-
-               <dependency>
-                       <groupId>com.github.fge</groupId>
-                       <artifactId>json-schema-validator</artifactId>
-                       <version>2.0.0</version>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.json</groupId>
-                       <artifactId>json</artifactId>
-                       <version>20180130</version>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-web</artifactId>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.springframework.boot</groupId>
-                                       <artifactId>spring-boot-starter-tomcat</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-jetty</artifactId>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter</artifactId>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>ch.qos.logback</groupId>
-                                       <artifactId>logback-classic</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-jersey</artifactId>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.springframework.boot</groupId>
-                                       <artifactId>spring-boot-starter-tomcat</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-actuator</artifactId>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-test</artifactId>
-                       <scope>test</scope>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-security</artifactId>
-               </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.directory.studio</groupId>
+            <artifactId>org.apache.commons.lang</artifactId>
+            <version>2.6</version>
+        </dependency>
+
+        <dependency>
+            <groupId>radeox</groupId>
+            <artifactId>radeox</artifactId>
+            <version>0.9</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.fge</groupId>
+            <artifactId>json-schema-validator</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20180130</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jetty</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>ch.qos.logback</groupId>
+                    <artifactId>logback-classic</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jersey</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
 
         <!--Logback classic-->
-               <dependency>
-                       <groupId>ch.qos.logback</groupId>
-                       <artifactId>logback-classic</artifactId>
-               </dependency>
-
-               <dependency>
-                       <groupId>ch.qos.logback</groupId>
-                       <artifactId>logback-core</artifactId>
-               </dependency>
-
-       </dependencies>
-
-       <repositories>
-               <repository>
-                       <id>central</id>
-                       <name>Maven 2 repository 2</name>
-                       <url>http://repo2.maven.org/maven2/</url>
-               </repository>
-               <repository>
-                       <id>ecomp-releases</id>
-                       <name>ECOMP Release Repository</name>
-                       <url>${nexusproxy}/content/repositories/releases/</url>
-               </repository>
-               <repository>
-                       <id>ecomp-snapshots</id>
-                       <name>ECOMP Snapshot Repository</name>
-                       <url>${nexusproxy}/content/repositories/snapshots/</url>
-               </repository>
-               <repository>
-                       <id>ecomp-staging</id>
-                       <name>ECOMP Staging Repository</name>
-                       <url>${nexusproxy}/content/repositories/staging/</url>
-               </repository>
-       </repositories>
-
-       <build>
-               <finalName>search-data-service-package</finalName>
-               <plugins>
-                       <plugin>
-                               <groupId>org.springframework.boot</groupId>
-                               <artifactId>spring-boot-maven-plugin</artifactId>
-                       </plugin>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>central</id>
+            <name>Maven 2 repository 2</name>
+            <url>http://repo2.maven.org/maven2/</url>
+        </repository>
+        <repository>
+            <id>ecomp-releases</id>
+            <name>ECOMP Release Repository</name>
+            <url>${nexusproxy}/content/repositories/releases/</url>
+        </repository>
+        <repository>
+            <id>ecomp-snapshots</id>
+            <name>ECOMP Snapshot Repository</name>
+            <url>${nexusproxy}/content/repositories/snapshots/</url>
+        </repository>
+        <repository>
+            <id>ecomp-staging</id>
+            <name>ECOMP Staging Repository</name>
+            <url>${nexusproxy}/content/repositories/staging/</url>
+        </repository>
+    </repositories>
+    
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>build-helper-maven-plugin</artifactId>
+                        <version>3.0.0</version>
+                    </plugin>
+                    <plugin>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>src/main/assembly/descriptor.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>make-assembly</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.codehaus.groovy.maven</groupId>
+                        <artifactId>gmaven-plugin</artifactId>
+                        <version>1.0</version>
+                        <executions>
+                            <execution>
+                                <phase>prepare-package</phase>
+                                <goals>
+                                    <goal>execute</goal>
+                                </goals>
+                                <configuration>
+                                    <source>
+                                        def userAaiBaseImage = session.userProperties['aai.base.image']
+                                        def userAaiCommonVersion = session.userProperties['aai.base.image.version']
+                                        if (userAaiCommonVersion != null) {
+                                            project.properties['aai.base.image.version'] = userAaiCommonVersion
+                                        }
+                                        if (userAaiBaseImage != null) {
+                                            project.properties['aai.base.image'] = userAaiBaseImage
+                                        }
+                                        log.info 'Base image flavour: ' + project.properties['aai.base.image']
+                                        log.info 'Base image version: ' + project.properties['aai.base.image.version']
+                                    </source>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <version>${docker.fabric.version}</version>
+                        <configuration>
+                            <verbose>true</verbose>
+                            <apiVersion>1.23</apiVersion>
+                            <images>
+                                <image>
+                                    <name>${docker.push.registry}/${aai.docker.namespace}/${docker.image.name.suffix}:%l
+                                    </name>
+                                    <build>
+                                        <filter>@</filter>
+                                        <tags>
+                                            <tag>latest</tag>
+                                            <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
+                                            <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
+                                        </tags>
+                                        <cleanup>try</cleanup>
+                                        <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
+                                        <assembly>
+                                            <inline>
+                                                <fileSets>
+                                                    <fileSet>
+                                                        <directory>${aai.build.directory}</directory>
+                                                        <outputDirectory>/${project.artifactId}</outputDirectory>
+                                                    </fileSet>
+                                                </fileSets>
+                                            </inline>
+                                        </assembly>
+                                    </build>
+                                </image>
+                            </images>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>clean-images</id>
+                                <phase>clean</phase>
+                                <goals>
+                                    <goal>remove</goal>
+                                </goals>
+                                <configuration>
+                                    <removeAll>true</removeAll>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>generate-images</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>build</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>push-images</id>
+                                <phase>deploy</phase>
+                                <goals>
+                                    <goal>push</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+    <build>
+        <finalName>${project.artifactId}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
             <!-- Checkstyle plugin - used to report on compliance with -->
             <!-- the Google style guide. -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-site-plugin</artifactId>
-                               <configuration>
-                                       <reportPlugins>
-                                               <plugin>
-                                                       <groupId>org.apache.maven.plugins</groupId>
-                                                       <artifactId>maven-checkstyle-plugin</artifactId>
-                                                       <version>2.17</version>
-                                                       <reportSets>
-                                                               <reportSet>
-                                                                       <reports>
-                                                                               <report>checkstyle</report>
-                                                                       </reports>
-                                                               </reportSet>
-                                                       </reportSets>
-                                               </plugin>
-                                       </reportPlugins>
-                               </configuration>
-                       </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+                <configuration>
+                    <reportPlugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-checkstyle-plugin</artifactId>
+                            <version>2.17</version>
+                            <reportSets>
+                                <reportSet>
+                                    <reports>
+                                        <report>checkstyle</report>
+                                    </reports>
+                                </reportSet>
+                            </reportSets>
+                        </plugin>
+                    </reportPlugins>
+                </configuration>
+            </plugin>
             <!-- This plugin overrides the compiler settings to use java 1.8 -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                               <configuration>
-                                       <compilerId>groovy-eclipse-compiler</compilerId>
-                                       <verbose>true</verbose>
-                                       <source>1.8</source>
-                                       <target>1.8</target>
-                               </configuration>
-                               <dependencies>
-                                       <dependency>
-                                               <groupId>org.codehaus.groovy</groupId>
-                                               <artifactId>groovy-eclipse-compiler</artifactId>
-                                               <version>2.9.0-01</version>
-                                       </dependency>
-                                       <dependency>
-                                               <groupId>org.codehaus.groovy</groupId>
-                                               <artifactId>groovy-eclipse-batch</artifactId>
-                                               <version>2.3.4-01</version>
-                                       </dependency>
-                               </dependencies>
-                       </plugin>
-                       <plugin>
-                               <groupId>com.spotify</groupId>
-                               <artifactId>docker-maven-plugin</artifactId>
-                               <version>0.4.11</version>
-                               <configuration>
-                                       <verbose>true</verbose>
-                                       <serverId>docker-hub</serverId>
-                                       <imageName>${docker.push.registry}/onap/${docker.image.name.suffix}</imageName>
-                                       <dockerDirectory>${docker.location}</dockerDirectory>
-                                       <imageTags>
-                                               <imageTag>latest</imageTag>
-                                       </imageTags>
-                                       <forceTags>true</forceTags>
-                               </configuration>
-                       </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerId>groovy-eclipse-compiler</compilerId>
+                    <verbose>true</verbose>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.codehaus.groovy</groupId>
+                        <artifactId>groovy-eclipse-compiler</artifactId>
+                        <version>2.9.0-01</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.codehaus.groovy</groupId>
+                        <artifactId>groovy-eclipse-batch</artifactId>
+                        <version>2.3.4-01</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
             <!-- This plugin is used to generate Java POJO's from json format schema
                 file. -->
-                       <plugin>
-                               <groupId>org.jsonschema2pojo</groupId>
-                               <artifactId>jsonschema2pojo-maven-plugin</artifactId>
-                               <version>0.4.26</version>
-                               <configuration>
-                                       <addCompileSourceRoot>true</addCompileSourceRoot>
-                                       <sourceDirectory>${basedir}/src/main/resources/json/schema</sourceDirectory>
-                                       <outputDirectory>${generatedSourceDir}</outputDirectory>
-                                       <targetPackage>org.onap.aai.sa.rest</targetPackage>
-                               </configuration>
-                               <executions>
-                                       <execution>
-                                               <goals>
-                                                       <goal>generate</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
-
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-resources-plugin</artifactId>
-                               <executions>
-                                       <execution>
-                                               <id>copy-docker-file</id>
-                                               <phase>package</phase>
-                                               <goals>
-                                                       <goal>copy-resources</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <outputDirectory>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>
+            <plugin>
+                <groupId>org.jsonschema2pojo</groupId>
+                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
+                <version>0.4.26</version>
+                <configuration>
+                    <addCompileSourceRoot>true</addCompileSourceRoot>
+                    <sourceDirectory>${basedir}/src/main/resources/json/schema</sourceDirectory>
+                    <outputDirectory>${generatedSourceDir}</outputDirectory>
+                    <targetPackage>org.onap.aai.sa.rest</targetPackage>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
             <!-- license plugin -->
-                       <plugin>
-                               <groupId>com.mycila</groupId>
-                               <artifactId>license-maven-plugin</artifactId>
-                               <version>3.0</version>
-                               <configuration>
-                                       <header>License.txt</header>
-                                       <includes>
-                                               <include>src/main/java/**</include>
-                                               <include>src/test/java/**</include>
-                                               <include>pom.xml</include>
-                                       </includes>
-                                       <skipExistingHeaders>true</skipExistingHeaders>
-                               </configuration>
-                               <executions>
-                                       <execution>
-                                               <goals>
-                                                       <goal>check</goal>
-                                               </goals>
-                                               <phase>validate</phase>
-                                       </execution>
-                               </executions>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-deploy-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.codehaus.mojo</groupId>
-                               <artifactId>sonar-maven-plugin</artifactId>
-                               <version>3.2</version>
-                       </plugin>
-                        <!-- jacoco-maven-plugin provides the basic report creation during unit testing, such as code-coverage, sonar, etc. -->
-                       <plugin>
-                               <groupId>org.jacoco</groupId>
-                               <artifactId>jacoco-maven-plugin</artifactId>
-                               <executions>
-                                       <!-- Prepares the property pointing to the JaCoCo runtime agent which
-                                                is passed as VM argument when Maven the Surefire plugin is executed. -->
-                                       <execution>
-                                               <id>pre-unit-test</id>
-                                               <goals>
-                                                       <goal>prepare-agent</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <!-- Sets the path to the file which contains the execution data. -->
-                                                       <destFile>${sonar.jacoco.reportPath}</destFile>
-                                                       <propertyName>surefireArgLine</propertyName>
-                                               </configuration>
-                                       </execution>
-                                       <!-- Ensures that the code coverage report for unit tests is created
-                                                after unit tests have been run. -->
-                                       <execution>
-                                               <id>post-unit-test</id>
-                                               <phase>test</phase>
-                                               <goals>
-                                                       <goal>report</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <!-- Sets the path to the file which contains the execution data. -->
-                                                       <dataFile>${sonar.jacoco.reportPath}</dataFile>
-                                                       <!-- Sets the output directory for the code coverage report. -->
-                                                       <outputDirectory>${jacoco.path}</outputDirectory>
-                                               </configuration>
-                                       </execution>
-                                       <!-- Prepares the property pointing to the JaCoCo runtime agent which
-                                                is passed as VM argument when Maven the Failsafe plugin is executed. -->
-                                       <execution>
-                                               <id>pre-integration-test</id>
-                                               <phase>pre-integration-test</phase>
-                                               <goals>
-                                                       <goal>prepare-agent</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <!-- Sets the path to the file which contains the execution data. -->
-                                                       <destFile>${sonar.jacoco.itReportPath}</destFile>
-                                                       <!-- Sets the name of the property containing the settings for JaCoCo
-                                                                runtime agent. -->
-                                                       <propertyName>failsafeArgLine</propertyName>
-                                               </configuration>
-                                       </execution>
-                                       <!-- Ensures that the code coverage report for integration tests after
-                                                integration tests have been run. -->
-                                       <execution>
-                                               <id>post-integration-test</id>
-                                               <phase>post-integration-test</phase>
-                                               <goals>
-                                                       <goal>report</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <!-- Sets the path to the file which contains the execution data. -->
-                                                       <dataFile>${sonar.jacoco.itReportPath}/</dataFile>
-                                                       <!-- Sets the output directory for the code coverage report. -->
-                                                       <outputDirectory>${jacoco.itPath}</outputDirectory>
-                                               </configuration>
-                                       </execution>
-                                       <execution>
-                                               <id>default-check</id>
-                                               <goals>
-                                                       <goal>check</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
-                                                       <rules>
-                                                               <!--  implementation is needed only for Maven 2  -->
-                                                               <rule implementation="org.jacoco.maven.RuleConfiguration">
-                                                                       <element>BUNDLE</element>
-                                                                       <limits>
-                                                                               <limit implementation="org.jacoco.report.check.Limit">
-                                                                                       <counter>LINE</counter>
-                                                                                       <value>COVEREDRATIO</value>
-                                                                                       <minimum>${jacoco.line.coverage.limit}</minimum>
-                                                                               </limit>
-                                                                       </limits>
-                                                               </rule>
-                                                       </rules>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
+            <plugin>
+                <groupId>com.mycila</groupId>
+                <artifactId>license-maven-plugin</artifactId>
+                <version>3.0</version>
+                <configuration>
+                    <header>License.txt</header>
+                    <includes>
+                        <include>src/main/java/**</include>
+                        <include>src/test/java/**</include>
+                        <include>pom.xml</include>
+                    </includes>
+                    <skipExistingHeaders>true</skipExistingHeaders>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                        <phase>validate</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>sonar-maven-plugin</artifactId>
+                <version>3.2</version>
+            </plugin>
+            <!-- jacoco-maven-plugin provides the basic report creation during unit testing, such as code-coverage, sonar, etc. -->
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <executions>
+                    <!-- Prepares the property pointing to the JaCoCo runtime agent which
+                         is passed as VM argument when Maven the Surefire plugin is executed. -->
+                    <execution>
+                        <id>pre-unit-test</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                        <configuration>
+                            <!-- Sets the path to the file which contains the execution data. -->
+                            <destFile>${sonar.jacoco.reportPath}</destFile>
+                            <propertyName>surefireArgLine</propertyName>
+                        </configuration>
+                    </execution>
+                    <!-- Ensures that the code coverage report for unit tests is created
+                         after unit tests have been run. -->
+                    <execution>
+                        <id>post-unit-test</id>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>report</goal>
+                        </goals>
+                        <configuration>
+                            <!-- Sets the path to the file which contains the execution data. -->
+                            <dataFile>${sonar.jacoco.reportPath}</dataFile>
+                            <!-- Sets the output directory for the code coverage report. -->
+                            <outputDirectory>${jacoco.path}</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <!-- Prepares the property pointing to the JaCoCo runtime agent which
+                         is passed as VM argument when Maven the Failsafe plugin is executed. -->
+                    <execution>
+                        <id>pre-integration-test</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                        <configuration>
+                            <!-- Sets the path to the file which contains the execution data. -->
+                            <destFile>${sonar.jacoco.itReportPath}</destFile>
+                            <!-- Sets the name of the property containing the settings for JaCoCo
+                                 runtime agent. -->
+                            <propertyName>failsafeArgLine</propertyName>
+                        </configuration>
+                    </execution>
+                    <!-- Ensures that the code coverage report for integration tests after
+                         integration tests have been run. -->
+                    <execution>
+                        <id>post-integration-test</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>report</goal>
+                        </goals>
+                        <configuration>
+                            <!-- Sets the path to the file which contains the execution data. -->
+                            <dataFile>${sonar.jacoco.itReportPath}/</dataFile>
+                            <!-- Sets the output directory for the code coverage report. -->
+                            <outputDirectory>${jacoco.itPath}</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>default-check</id>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                        <configuration>
+                            <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
+                            <rules>
+                                <!--  implementation is needed only for Maven 2  -->
+                                <rule implementation="org.jacoco.maven.RuleConfiguration">
+                                    <element>BUNDLE</element>
+                                    <limits>
+                                        <limit implementation="org.jacoco.report.check.Limit">
+                                            <counter>LINE</counter>
+                                            <value>COVEREDRATIO</value>
+                                            <minimum>${jacoco.line.coverage.limit}</minimum>
+                                        </limit>
+                                    </limits>
+                                </rule>
+                            </rules>
+                        </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>
-                               <configuration>
-                                       <filesets>
-                                               <fileset>
-                                                       <directory>${generatedSourceDir}</directory>
-                                               </fileset>
-                                       </filesets>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <distributionManagement>
-               <repository>
-                       <id>ecomp-releases</id>
-                       <name>ECOMP Release Repository</name>
-                       <url>${nexusproxy}/content/repositories/releases/</url>
-               </repository>
-               <snapshotRepository>
-                       <id>ecomp-snapshots</id>
-                       <name>ECOMP Snapshot Repository</name>
-                       <url>${nexusproxy}/content/repositories/snapshots/</url>
-               </snapshotRepository>
-               <site>
-                       <id>ecomp-javadoc</id>
-                       <url>dav:https://ecomp-nexus:8443/repository/aai/search-data-service-javadoc/${project.version}</url>
-               </site>
-       </distributionManagement>
+            <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>${generatedSourceDir}</directory>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <distributionManagement>
+        <repository>
+            <id>ecomp-releases</id>
+            <name>ECOMP Release Repository</name>
+            <url>${nexusproxy}/content/repositories/releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>ecomp-snapshots</id>
+            <name>ECOMP Snapshot Repository</name>
+            <url>${nexusproxy}/content/repositories/snapshots/</url>
+        </snapshotRepository>
+        <site>
+            <id>ecomp-javadoc</id>
+            <url>dav:https://ecomp-nexus:8443/repository/aai/search-data-service-javadoc/${project.version}</url>
+        </site>
+    </distributionManagement>
 </project>
diff --git a/search-data-service-app/src/main/assembly/descriptor.xml b/search-data-service-app/src/main/assembly/descriptor.xml
new file mode 100644 (file)
index 0000000..5e46871
--- /dev/null
@@ -0,0 +1,32 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"\r
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">\r
+    <id>build</id>\r
+    <includeBaseDirectory>false</includeBaseDirectory>\r
+    <formats>\r
+        <format>dir</format>\r
+    </formats>\r
+    <fileSets>\r
+        <fileSet>\r
+            <directory>${project.basedir}/bundleconfig-local</directory>\r
+            <outputDirectory>/bundleconfig</outputDirectory>\r
+            <includes>\r
+                <include>**/*</include>\r
+            </includes>\r
+        </fileSet>\r
+        <fileSet>\r
+            <directory>${project.basedir}/src/main/bin</directory>\r
+            <outputDirectory>/bin</outputDirectory>\r
+            <includes>\r
+                <include>**/*</include>\r
+            </includes>\r
+        </fileSet>\r
+    </fileSets>\r
+    <files>\r
+        <file>\r
+            <source>${project.build.directory}/${project.artifactId}.jar</source>\r
+            <destName>${project.parent.artifactId}-package.jar</destName>\r
+            <outputDirectory>/</outputDirectory>\r
+        </file>\r
+    </files>\r
+</assembly>\r
index 1a70fd7..2d2abce 100644 (file)
@@ -1,26 +1,14 @@
-FROM ubuntu:14.04
+FROM @aai.docker.namespace@/aai-common-@aai.base.image@:@aai.base.image.version@
 
 ARG MICRO_HOME=/opt/app/search-data-service
 ARG BIN_HOME=$MICRO_HOME/bin
 
-## Install and setup java8
-RUN apt-get update && apt-get install -y software-properties-common
-## sudo -E is required to preserve the environment. If you remove that line, it will most like freeze at this step
-RUN sudo -E add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk
-## Setup JAVA_HOME, this is useful for docker commandline
-ENV JAVA_HOME usr/lib/jvm/java-8-openjdk-amd64
-RUN export JAVA_HOME
-
 # Build up the deployment folder structure
-RUN mkdir -p $MICRO_HOME
-RUN mkdir -p $MICRO_HOME/bundleconfig/etc
-ADD *.jar $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 755 $BIN_HOME/*
-RUN ln -s /logs $MICRO_HOME/logs
+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
 
 EXPOSE 9509 9509