move packages build + tweaking pom.xml

Change-Id: Iac032aa8f379cc8d614ec7913b41a68cbda9674d
Issue-ID: POLICY-162
Signed-off-by: Jorge Hernandez <jh1730@att.com>
diff --git a/controlloop/common/pom.xml b/controlloop/common/pom.xml
index 76f788a..f3975b9 100644
--- a/controlloop/common/pom.xml
+++ b/controlloop/common/pom.xml
@@ -37,7 +37,6 @@
     	<module>eventmanager</module>
         <module>guard</module>
         <module>model-impl</module>
-    	<module>packages</module>
     	<module>policy-yaml</module>
     </modules>
 
diff --git a/controlloop/common/packages/apps/pom.xml b/controlloop/packages/apps/pom.xml
similarity index 100%
rename from controlloop/common/packages/apps/pom.xml
rename to controlloop/packages/apps/pom.xml
diff --git a/controlloop/common/packages/apps/src/assembly/zip.xml b/controlloop/packages/apps/src/assembly/zip.xml
similarity index 100%
rename from controlloop/common/packages/apps/src/assembly/zip.xml
rename to controlloop/packages/apps/src/assembly/zip.xml
diff --git a/controlloop/common/packages/apps/src/files/README.apps.txt b/controlloop/packages/apps/src/files/README.apps.txt
similarity index 100%
rename from controlloop/common/packages/apps/src/files/README.apps.txt
rename to controlloop/packages/apps/src/files/README.apps.txt
diff --git a/controlloop/common/packages/artifacts/pom.xml b/controlloop/packages/artifacts/pom.xml
similarity index 86%
rename from controlloop/common/packages/artifacts/pom.xml
rename to controlloop/packages/artifacts/pom.xml
index e68b9ee..cce85c7 100644
--- a/controlloop/common/packages/artifacts/pom.xml
+++ b/controlloop/packages/artifacts/pom.xml
@@ -57,7 +57,7 @@
 		</plugins>
 	</build>
 
-	<!-- The following are placed in the local repository at installation -->
+	<!-- The following are placed in the local or remote repository at installation -->
 	<dependencies>
 		<dependency>
 			<groupId>org.onap.policy.drools-applications</groupId>
@@ -132,5 +132,23 @@
 			<version>${project.version}</version>
 			<type>jar</type>
 		</dependency>
+		<dependency>
+			<groupId>org.onap.policy.drools-applications</groupId>
+			<artifactId>demo</artifactId>
+			<version>${project.version}</version>
+			<type>jar</type>
+		</dependency>
+		<dependency>
+			<groupId>org.onap.policy.drools-applications</groupId>
+			<artifactId>template.demo</artifactId>
+			<version>${project.version}</version>
+			<type>jar</type>
+		</dependency>
+		<dependency>
+			<groupId>org.onap.policy.drools-applications</groupId>
+			<artifactId>archetype-closedloop-demo-rules</artifactId>
+			<version>${project.version}</version>
+			<type>jar</type>
+		</dependency>
 	</dependencies>
 </project>
diff --git a/controlloop/common/packages/artifacts/src/assembly/zip.xml b/controlloop/packages/artifacts/src/assembly/zip.xml
similarity index 100%
rename from controlloop/common/packages/artifacts/src/assembly/zip.xml
rename to controlloop/packages/artifacts/src/assembly/zip.xml
diff --git a/controlloop/common/packages/basex/pom.xml b/controlloop/packages/basex/pom.xml
similarity index 100%
rename from controlloop/common/packages/basex/pom.xml
rename to controlloop/packages/basex/pom.xml
diff --git a/controlloop/common/packages/basex/src/assembly/zip.xml b/controlloop/packages/basex/src/assembly/zip.xml
similarity index 100%
rename from controlloop/common/packages/basex/src/assembly/zip.xml
rename to controlloop/packages/basex/src/assembly/zip.xml
diff --git a/controlloop/common/packages/basex/src/files/bin/create-closed-loop-demo.sh b/controlloop/packages/basex/src/files/bin/create-closed-loop-demo.sh
old mode 100755
new mode 100644
similarity index 99%
rename from controlloop/common/packages/basex/src/files/bin/create-closed-loop-demo.sh
rename to controlloop/packages/basex/src/files/bin/create-closed-loop-demo.sh
index 5fe8353..be98012
--- a/controlloop/common/packages/basex/src/files/bin/create-closed-loop-demo.sh
+++ b/controlloop/packages/basex/src/files/bin/create-closed-loop-demo.sh
@@ -29,7 +29,7 @@
 
 GROUPID="org.onap.policy.demo.rules"
 ARTIFACTID="closed-loop-demo-rules"
-VERSION="1.1.0-SNAPSHOT"
+VERSION="1.1.0"
 PACKAGE="org.onap.policy.demo.rules"
 CLOSEDLOOPCONTROLNAME="CL-FRWL-LOW-TRAFFIC-SIG-d925ed73-8231-4d02-9545-db4e101f88f8"
 POLICYSCOPE="service=test;resource=FRWL;type=configuration"
@@ -232,7 +232,7 @@
 (
 cd "${DIR_TMP}"
 
-"$M2_HOME"/bin/mvn archetype:generate \
+mvn archetype:generate \
     -B \
     -DarchetypeCatalog=local \
     -DarchetypeGroupId="${ARCHETYPE_GROUP_ID}" \
@@ -299,7 +299,7 @@
 echo
 echo "generating deployable ${ARTIFACTID} maven artifact .."
 
-"$M2_HOME"/bin/mvn install
+mvn install
 
 if [ "${?}" -ne 0 ]; then
 	echo
diff --git a/controlloop/common/packages/basex/src/files/config/vDNS-controller.properties b/controlloop/packages/basex/src/files/config/vDNS-controller.properties
similarity index 100%
rename from controlloop/common/packages/basex/src/files/config/vDNS-controller.properties
rename to controlloop/packages/basex/src/files/config/vDNS-controller.properties
diff --git a/controlloop/common/packages/basex/src/files/config/vFW-controller.properties b/controlloop/packages/basex/src/files/config/vFW-controller.properties
similarity index 100%
rename from controlloop/common/packages/basex/src/files/config/vFW-controller.properties
rename to controlloop/packages/basex/src/files/config/vFW-controller.properties
diff --git a/controlloop/common/packages/pom.xml b/controlloop/packages/pom.xml
similarity index 97%
rename from controlloop/common/packages/pom.xml
rename to controlloop/packages/pom.xml
index ea54a33..f4ccb14 100644
--- a/controlloop/common/packages/pom.xml
+++ b/controlloop/packages/pom.xml
@@ -25,7 +25,7 @@
 
 	<parent>
 		<groupId>org.onap.policy.drools-applications</groupId>
-		<artifactId>common</artifactId>
+		<artifactId>controlloop</artifactId>
 		<version>1.1.0-SNAPSHOT</version>
 	</parent>
 
diff --git a/controlloop/pom.xml b/controlloop/pom.xml
index 8cb9ef4..9765f9b 100644
--- a/controlloop/pom.xml
+++ b/controlloop/pom.xml
@@ -35,6 +35,7 @@
     <modules>
     	<module>common</module>
     	<module>templates</module>
+    	<module>packages</module>
     </modules>
 
 
diff --git a/controlloop/templates/template.demo.v1.0.0/archetype-closedloop-demo-rules/pom.xml b/controlloop/templates/template.demo.v1.0.0/archetype-closedloop-demo-rules/pom.xml
index 2e43a60..6eae974 100644
--- a/controlloop/templates/template.demo.v1.0.0/archetype-closedloop-demo-rules/pom.xml
+++ b/controlloop/templates/template.demo.v1.0.0/archetype-closedloop-demo-rules/pom.xml
@@ -40,7 +40,7 @@
 			<extension>
 				<groupId>org.apache.maven.archetype</groupId>
 				<artifactId>archetype-packaging</artifactId>
-				<version>2.4</version>
+				<version>3.0.1</version>
 			</extension>
 		</extensions>
 
@@ -48,7 +48,7 @@
 			<plugins>
 				<plugin>
 					<artifactId>maven-archetype-plugin</artifactId>
-					<version>2.4</version>
+					<version>3.0.1</version>
 				</plugin>
 			</plugins>
 		</pluginManagement>
diff --git a/controlloop/templates/template.demo.v1.0.0/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/pom.xml b/controlloop/templates/template.demo.v1.0.0/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/pom.xml
index c023a74..b0a7639 100644
--- a/controlloop/templates/template.demo.v1.0.0/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/pom.xml
+++ b/controlloop/templates/template.demo.v1.0.0/archetype-closedloop-demo-rules/src/main/resources/archetype-resources/pom.xml
@@ -38,11 +38,6 @@
 	<dependencies>
 		<dependency>
 			<groupId>org.onap.policy.drools-applications</groupId>
-			<artifactId>demo</artifactId>
-			<version>${dependenciesVersion}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.onap.policy.drools-applications</groupId>
 			<artifactId>events</artifactId>
 			<version>${dependenciesVersion}</version>
 		</dependency>