Rework Pom and Dockerfile

Rework the pom & swagger config
+ Remove license plugin in pom and license files
+ Rework the dockerfile (support all clamp versions now)
+ Introduce the version.properties

Change-Id: Ia823e00309d651ca40ef12beeae02fb01d8a80a9
Issue-Id: CLAMP-1
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
diff --git a/pom.xml b/pom.xml
index b853ccf..e76cbf3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,35 +4,39 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.onap.clamp</groupId>
 	<artifactId>clds</artifactId>
-	<version>1.0.0-SNAPSHOT</version>
+	<version>1.0.1-SNAPSHOT</version>
 	<name>ONAP CLAMP</name>
 
-    <parent>
-        <groupId>org.onap.oparent</groupId>
-        <artifactId>oparent</artifactId>
-        <version>1.0.0-SNAPSHOT</version>
-    </parent>
-    
+	<description>
+           This project build the ONAP CLAMP JAR that contains AJSC + CLAMP code.
+
+           By Default "mvn clean install" command will execute also the unit tests
+           and the integration tests. The integration tests require a docker engine running.
+
+           If you want to skip the intergation test you can by doing:
+           "mvn clean install -DskipITs=true"
+
+           For Spring it's possible to specify the application.properties location
+           "mvn clean install -Dspring.config.location=classpath:application-test.properties"
+
+           The application.properties contains the location of the CLAMP parameters files:
+           clds-policy-config.properties and clds-reference.properties
+    </description>
+
 	<properties>
 		<maven.compiler.source>1.8</maven.compiler.source>
 		<maven.compiler.target>1.8</maven.compiler.target>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <docker.mariadb.port.host>3306</docker.mariadb.port.host>
+		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+		<docker.mariadb.port.host>3306</docker.mariadb.port.host>
 		<sdk.java.common.logging>0.0.3-oss</sdk.java.common.logging>
 		<project.scm.id>git-server</project.scm.id>
-		<swagger.directory>${basedir}/target/classes/META-INF/resources/icd</swagger.directory>
-		<icd.file>service.json</icd.file>
-		<icd.package>org.onap.clamp.clds.service.rs</icd.package>
 		<java.version>1.8</java.version>
-		<build.number>local</build.number>
-		<service.account>ajsc-svc-account</service.account>
-		<namespace>com.att.ajsc</namespace>
-		<jsf.version>2.2.11</jsf.version>
 		<csi.logging>6.1.0.6-oss</csi.logging>
 		<sdk.camel.rest>6.2.0.6-oss</sdk.camel.rest>
 		<sdk.camunda.core>6.1.0.3-oss</sdk.camunda.core>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
 		<sonar.language>java</sonar.language>
 		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
 		<sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
@@ -78,16 +82,6 @@
 			<url>http://repo2.maven.org/maven2/</url>
 		</repository>
 		<repository>
-			<id>JBOSS</id>
-			<name>JBoss Repository</name>
-			<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
-		</repository>
-		<repository>
-			<id>jboss-deprecated-repository</id>
-			<name>JBoss Deprecated Maven Repository</name>
-			<url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url>
-		</repository>
-		<repository>
 			<id>ecomp-releases</id>
 			<name>ONAP Release Repository</name>
 			<url>${nexusproxy}/${releaseNexusPath}</url>
@@ -101,8 +95,12 @@
 			<id>ecomp-snapshots</id>
 			<name>ONAP Snapshot Repository</name>
 			<url>${nexusproxy}/${snapshotNexusPath}</url>
-			<snapshots><enabled>true</enabled></snapshots>
-			<releases><enabled>false</enabled></releases>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+			<releases>
+				<enabled>false</enabled>
+			</releases>
 		</repository>
 		<repository>
 			<id>spring-repo</id>
@@ -110,31 +108,12 @@
 			<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
 		</repository>
 		<repository>
-			<id>soapUI</id>
-			<url>http://www.soapui.org/repository/maven2/</url>
-			<name>SoapUI plugin</name>
+			<id>repository.jboss.org-public</id>
+			<name>JBoss.org Maven repository</name>
+			<url>https://repository.jboss.org/nexus/content/groups/public</url>
 		</repository>
 	</repositories>
 
-	<description>
-	       This project build the ONAP CLAMP JAR that contains AJSC + CLAMP code.
-
-           By Default "mvn clean install" command will execute also the unit tests
-           and the integration tests. The integration tests require a docker engine running.
-
-           If you want to skip the intergation test you can by doing:
-           "mvn clean install -DskipITs=true"
-
-           For Spring it's possible to specify the application.properties location
-           "mvn clean install -Dspring.config.location=classpath:application-test.properties"
-
-           The application.properties contains the location of the CLAMP parameters files:
-           clds-policy-config.properties and clds-reference.properties
-
-           The licenses and headers can be generated by using this maven command:
-           mvn license:update-file-header license:update-project-license
-    </description>
-
 	<dependencyManagement>
 		<dependencies>
 			<dependency>
@@ -149,11 +128,26 @@
 	</dependencyManagement>
 
 	<dependencies>
-	    <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-vfs2</artifactId>
-            <version>2.0</version>
-        </dependency>
+
+		<dependency>
+			<groupId>com.googlecode.json-simple</groupId>
+			<artifactId>json-simple</artifactId>
+			<version>1.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-vfs2</artifactId>
+			<version>2.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework.security</groupId>
+			<artifactId>spring-security-test</artifactId>
+
+			<scope>test</scope>
+		</dependency>
+
+
 		<!-- Dependencies of parent pom start -->
 		<dependency>
 			<groupId>com.att.ajsc</groupId>
@@ -170,9 +164,9 @@
 			<artifactId>spring-boot-starter-actuator</artifactId>
 		</dependency>
 		<dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-security</artifactId>
-        </dependency> 
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-security</artifactId>
+		</dependency>
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-test</artifactId>
@@ -332,6 +326,10 @@
 					<artifactId>apache-log4j-extras</artifactId>
 					<groupId>log4j</groupId>
 				</exclusion>
+				<exclusion>
+					<artifactId>jackson-databind</artifactId>
+					<groupId>com.fasterxml.jackson.core</groupId>
+				</exclusion>
 			</exclusions>
 		</dependency>
 		<dependency>
@@ -354,29 +352,33 @@
 			</exclusions>
 		</dependency>
 		<dependency>
-            <groupId>org.onap.policy.engine</groupId>
-            <artifactId>ControlloopPolicy</artifactId>
-            <version>1.1.0-SNAPSHOT</version>
-            <exclusions>
-                <exclusion>
-                    <artifactId>log4j</artifactId>
-                    <groupId>log4j</groupId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-log4j12</artifactId>
-                </exclusion>
-                <exclusion>
-                    <artifactId>apache-log4j-extras</artifactId>
-                    <groupId>log4j</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
+			<groupId>org.onap.policy.engine</groupId>
+			<artifactId>ControlloopPolicy</artifactId>
+			<version>1.1.0-SNAPSHOT</version>
+			<exclusions>
+				<exclusion>
+					<artifactId>log4j</artifactId>
+					<groupId>log4j</groupId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.slf4j</groupId>
+					<artifactId>slf4j-log4j12</artifactId>
+				</exclusion>
+				<exclusion>
+					<artifactId>apache-log4j-extras</artifactId>
+					<groupId>log4j</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
 
 		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>2.6.3</version>
+		</dependency>
+		<dependency>
 			<groupId>com.fasterxml.jackson.dataformat</groupId>
 			<artifactId>jackson-dataformat-yaml</artifactId>
-			<!-- >version>2.0.0-RC1</version <version>${fasterxml.jackson.version}</version -->
 			<version>2.6.3</version>
 		</dependency>
 		<dependency>
@@ -403,14 +405,16 @@
 	</dependencies>
 
 	<build>
+		<finalName>clamp</finalName>
+
 		<testResources>
-		    <testResource>
-                <directory>src/test/resources</directory>
-                <includes>
-                    <include>**/*</include>
-                </includes>
-                <filtering>true</filtering>
-            </testResource>
+			<testResource>
+				<directory>src/test/resources</directory>
+				<includes>
+					<include>**/*</include>
+				</includes>
+				<filtering>true</filtering>
+			</testResource>
 		</testResources>
 		<resources>
 			<resource>
@@ -418,27 +422,6 @@
 				<filtering>true</filtering>
 			</resource>
 			<resource>
-				<directory>target/generated-sources/license</directory>
-				<includes>
-					<include>third-party-licenses.txt</include>
-				</includes>
-			</resource>
-			<resource>
-				<directory>target/generated-resources/licenses</directory>
-				<includes>
-					<include>*.*</include>
-				</includes>
-				<targetPath>third-party-licenses</targetPath>
-			</resource>
-			<resource>
-				<directory>${project.basedir}/etc</directory>
-				<targetPath>${project.build.directory}/etc</targetPath>
-				<filtering>true</filtering>
-				<includes>
-					<include>**/*</include>
-				</includes>
-			</resource>
-			<resource>
 				<directory>src/main/docker</directory>
 				<includes>
 					<include>**/*</include>
@@ -453,116 +436,80 @@
 				<filtering>true</filtering>
 			</resource>
 		</resources>
-		<pluginManagement>
-			<plugins>
-				<!--This plugin's configuration is used to store Eclipse m2e settings
-					only. It has no influence on the Maven build itself. -->
-				<plugin>
-					<groupId>org.apache.maven.plugins</groupId>
-					<artifactId>maven-release-plugin</artifactId>
-					<version>2.5.3</version>
-					<configuration>
-						<tagBase>${projectTag}</tagBase>
-						<scmCommentPrefix>${scm.commit.message}</scmCommentPrefix>
-					</configuration>
-				</plugin>
-				<plugin>
-					<groupId>com.github.kongchen</groupId>
-					<artifactId>swagger-maven-plugin</artifactId>
-					<version>3.1.3</version>
-					<configuration>
-						<apiSources>
-							<apiSource>
-								<locations>${icd.package}</locations>
-								<basePath>/</basePath>
-								<info>
-									<title>${project.artifactId} Service</title>
-									<version>${project.version}</version>
-								</info>
-								<swaggerDirectory>${swagger.directory}</swaggerDirectory>
-							</apiSource>
-						</apiSources>
-					</configuration>
-					<executions>
-						<execution>
-							<phase>compile</phase>
-							<goals>
-								<goal>generate</goal>
-							</goals>
-						</execution>
-					</executions>
-				</plugin>
-				<plugin>
-					<groupId>org.eclipse.m2e</groupId>
-					<artifactId>lifecycle-mapping</artifactId>
-					<version>1.0.0</version>
-					<configuration>
-						<lifecycleMappingMetadata>
-							<pluginExecutions>
-								<pluginExecution>
-									<pluginExecutionFilter>
-										<groupId>com.github.kongchen</groupId>
-										<artifactId>swagger-maven-plugin</artifactId>
-										<versionRange>3.1.3</versionRange>
-										<goals>
-											<goal>generate</goal>
-										</goals>
-									</pluginExecutionFilter>
-									<action>
-										<ignore />
-									</action>
-								</pluginExecution>
-							</pluginExecutions>
-						</lifecycleMappingMetadata>
-					</configuration>
-				</plugin>
-			</plugins>
-		</pluginManagement>
+
+
+
 		<plugins>
-		      <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>3.0.2</version>
-                <executions>
-                    <execution>
-                        <id>jar-with-only-classes</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                        <configuration>
-                            <classifier>classes</classifier>
-                            <excludes>
-                                <exclude>META-INF/resources/designer/**</exclude>
-                                <exclude>META-INF/resources/icd/**</exclude>
-                                <exclude>META-INF/resources/index.html</exclude>
-                            </excludes>
-                        </configuration>
-                    </execution>
-               </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <version>3.0.0</version>
-                <executions>
-                    <execution>
-                    <goals>
-                        <goal>attach-artifact</goal>
-                    </goals>
-                    <phase>package</phase>
-                        <configuration>
-                            <artifacts>
-                                <artifact>
-                                    <file>${project.build.directory}/clds-${project.version}-classes.jar</file>
-                                    <type>jar</type>
-                                    <classifier>classes</classifier>
-                                </artifact>
-                            </artifacts>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>3.0.2</version>
+				<executions>
+					<execution>
+						<id>jar-with-only-classes</id>
+						<phase>package</phase>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+						<configuration>
+							<classifier>classes</classifier>
+							<includes>
+								<include>org/**</include>
+							</includes>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>com.github.kongchen</groupId>
+				<artifactId>swagger-maven-plugin</artifactId>
+				<version>3.1.5</version>
+				<executions>
+					<execution>
+						<phase>compile</phase>
+						<goals>
+							<goal>generate</goal>
+						</goals>
+						<configuration>
+							<apiSources>
+								<apiSource>
+									<locations>
+										<location>org.onap.clamp.clds.service</location>
+									</locations>
+									<basePath>/</basePath>
+									<info>
+										<title>${project.artifactId} Service</title>
+										<version>${project.version}</version>
+									</info>
+									<swaggerDirectory>${project.build.directory}/classes/META-INF/resources/icd</swaggerDirectory>
+								</apiSource>
+							</apiSources>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>build-helper-maven-plugin</artifactId>
+				<version>3.0.0</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>attach-artifact</goal>
+						</goals>
+						<phase>package</phase>
+						<configuration>
+							<artifacts>
+								<artifact>
+									<file>${project.build.directory}/clamp-classes.jar</file>
+									<type>jar</type>
+									<classifier>classes</classifier>
+								</artifact>
+							</artifacts>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
 
 			<plugin>
 				<groupId>org.springframework.boot</groupId>
@@ -578,16 +525,6 @@
 				</executions>
 			</plugin>
 			<plugin>
-				<artifactId>maven-release-plugin</artifactId>
-				<dependencies>
-					<dependency>
-						<groupId>org.apache.maven.scm</groupId>
-						<artifactId>maven-scm-provider-gitexe</artifactId>
-						<version>1.9</version>
-					</dependency>
-				</dependencies>
-			</plugin>
-			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-gpg-plugin</artifactId>
 				<version>1.5</version>
@@ -617,36 +554,11 @@
 				</configuration>
 			</plugin>
 			<plugin>
-				<groupId>com.github.kongchen</groupId>
-				<artifactId>swagger-maven-plugin</artifactId>
-				<configuration>
-					<apiSources>
-						<apiSource>
-							<locations>org.onap.clamp.clds.service.rs</locations>
-							<basePath>//rest</basePath>
-							<info>
-								<title>${project.artifactId} Service</title>
-								<version>${project.version}</version>
-							</info>
-							<swaggerDirectory>${swagger.directory}</swaggerDirectory>
-						</apiSource>
-					</apiSources>
-				</configuration>
-				<executions>
-					<execution>
-						<phase>compile</phase>
-						<goals>
-							<goal>generate</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
 				<groupId>com.spotify</groupId>
 				<artifactId>docker-maven-plugin</artifactId>
 				<version>0.4.11</version>
 				<configuration>
-					<imageName>${docker.push.registry}/onap/clamp</imageName>
+					<imageName>onap/clamp</imageName>
 					<dockerDirectory>src/main/docker</dockerDirectory>
 					<serverId>docker-hub</serverId>
 					<imageTags>
@@ -665,6 +577,11 @@
 							<directory>${project.build.directory}</directory>
 							<include>etc/config/**</include>
 						</resource>
+						<resource>
+							<targetPath>/</targetPath>
+							<directory>${project.build.directory}</directory>
+							<include>etc/keystore/**</include>
+						</resource>
 					</resources>
 				</configuration>
 				<executions>
@@ -683,25 +600,13 @@
 						</configuration>
 					</execution>
 					<execution>
-						<id>tag-image</id>
-						<phase>package</phase>
-						<goals>
-							<goal>tag</goal>
-						</goals>
-						<configuration>
-							<image>onap/clamp</image>
-							<newName>${docker.push.registry}/onap/clamp</newName>
-							<pushImage>true</pushImage>
-							<skipDockerTag>${skip.docker.tag}</skipDockerTag>
-						</configuration>
-					</execution>
-					<execution>
 						<id>push-image</id>
 						<phase>deploy</phase>
 						<goals>
 							<goal>push</goal>
 						</goals>
 						<configuration>
+						    <imageName>onap/clamp</imageName>
 							<skipDockerPush>${skip.docker.push}</skipDockerPush>
 						</configuration>
 					</execution>
@@ -826,45 +731,26 @@
 							<!-- <append>true</append> -->
 						</configuration>
 					</execution>
+					<execution>
+						<goals>
+							<goal>merge</goal>
+						</goals>
+						<phase>post-integration-test</phase>
+						<configuration>
+							<fileSets>
+								<fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">
+									<directory>${project.build.directory}/coverage-reports</directory>
+									<includes>
+										<include>*.exec</include>
+									</includes>
+								</fileSet>
+							</fileSets>
+							<destFile>${project.build.directory}/jacoco-dev.exec</destFile>
+						</configuration>
+					</execution>
 				</executions>
 			</plugin>
 
-          <!-- license plugin -->
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>license-maven-plugin</artifactId>
-                <version>1.12</version>
-                <configuration>
-                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
-                    <projectName>ONAP CLAMP</projectName>
-                    <canUpdateCopyright>true</canUpdateCopyright>
-                    <canUpdateDescription>true</canUpdateDescription>
-                    <canUpdateLicense>true</canUpdateLicense>
-
-                    <processStartTag>============LICENSE_START=======================================================</processStartTag>
-                    <processEndTag><![CDATA[ECOMP &nbsp;is &nbsp;a &nbsp;trademark &nbsp;and &nbsp;service &nbsp;mark &nbsp;of &nbsp;AT&amp;T &nbsp;Intellectual &nbsp;Property.]]></processEndTag>
-                    <sectionDelimiter>================================================================================</sectionDelimiter>
-                    <organizationName>AT&amp;T Intellectual Property. All rights
-                            reserved.</organizationName>
-                    <inceptionYear>2017</inceptionYear>
-                    <emptyLineAfterHeader>true</emptyLineAfterHeader>
-
-                    <licenseName>clamp_apache_v2</licenseName>
-                    <licenseResolver>${project.baseUri}/src/licenses</licenseResolver>
-
-                    <excludes>
-                         <exclude>**/*.properties</exclude>
-                         <exclude>**/icd/**</exclude>
-                         <exclude>**/designer/lib/**</exclude>
-                         <exclude>**/*.json</exclude>
-                         <exclude>**/*.yaml</exclude>
-                         <exclude>**/*.yml</exclude>
-                         <exclude>**/licenses/**</exclude>
-                    </excludes>
-                </configuration>
-
-            </plugin>
-
 			<!-- This plugin will be useful when we will have multi-modules project -->
 			<plugin>
 				<groupId>org.codehaus.mojo</groupId>