Solve the install issues

Change-Id: I4402388c3d245a062299fd6d65fa152d63b8f08c
Signed-off-by: j00302280 <j00101220@huawei.com>
diff --git a/servicegateway/deployment/pom.xml b/servicegateway/deployment/pom.xml
index 88d6f4e..2f025e9 100644
--- a/servicegateway/deployment/pom.xml
+++ b/servicegateway/deployment/pom.xml
@@ -18,22 +18,97 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.openo.gso.gui</groupId>
-        <artifactId>servicegateway</artifactId>
+        <artifactId>service-gateway-root</artifactId>
         <version>1.0.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>deployment</artifactId>
-    <name>deployment</name>
-    <packaging>jar</packaging>
+    <artifactId>service-gateway-deployment</artifactId>
+    <name>ServiceGatewayRootDeployment</name>
+    <packaging>pom</packaging>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
-    <dependencies>
-        <dependency>
-            <groupId>org.openo.common-services.common-utilities</groupId>
-            <artifactId>commonlib-cbb</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
-        </dependency>
-    </dependencies>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.codehaus.gmaven</groupId>
+                    <artifactId>groovy-maven-plugin</artifactId>
+                    <version>2.0</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.gmaven</groupId>
+                <artifactId>gmaven-plugin</artifactId>
+                <version>1.5</version>
+                <executions>
+                    <execution>
+                        <id>ServiceGateway package</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <configuration>
+                            <source>
+                                System.out.println("******** Going to make release zip ********")
+
+                                deployFolder = "${project.build.directory}/deployoutput"
+                                deployUnzip = "${project.build.directory}/deployunzip"
+                                outfileName = "ServiceGateway-.${project.version}.zip"
+
+                                ant.delete(dir: "${deployFolder}")
+                                ant.mkdir(dir: "${deployFolder}")
+
+                                ant.delete(dir: "${deployUnzip}")
+                                ant.mkdir(dir: "${deployUnzip}")
+
+                                ant.mkdir(dir: "${deployUnzip}/webapps/ROOT")
+                                ant.mkdir(dir: "${deployUnzip}/webapps/openoui#servicegateway#v1")
+
+                                ant.copy(todir: "${deployUnzip}") {
+                                fileset(dir: "${basedir}/src/main/release"){
+                                exclude(name: "**/.gitignore")
+                                }
+                                }
+
+                                ant.copy(todir: "${deployUnzip}/webapps/ROOT") {
+                                fileset(dir: "${project.build.directory}/../../service/target/ROOT")
+                                }
+
+                                ant.zip(destfile: "${deployFolder}/${outfileName}") {
+                                fileset(dir: "${deployUnzip}")
+                                }
+                                System.out.println("******** completed. ************")
+                            </source>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+             <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>attach-artifacts</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attach-artifact</goal>
+                        </goals>
+                        <configuration>
+                            <artifacts>
+                                <artifact>
+                                    <file>${project.build.directory}/deployoutput/ServiceGateway-.${project.version}.zip</file>
+                                    <type>zip</type>
+                                </artifact>
+                            </artifacts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>