Fix deploy issue in common-tosca-catalog httpserver
authorGary Wu <gary.i.wu@huawei.com>
Fri, 2 Sep 2016 21:31:57 +0000 (14:31 -0700)
committerGary Wu <gary.i.wu@huawei.com>
Sat, 3 Sep 2016 05:26:37 +0000 (22:26 -0700)
Change-Id: I4325af634d104888b26111834a3c02fc3e445862
Issue-id: INT-40
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
catalog-core/httpserver/pom.xml

index 516aeef..93900fd 100644 (file)
         <artifactId>catalog-core-parent</artifactId>
         <version>1.0.0-SNAPSHOT</version>
     </parent>
-    
+
     <modelVersion>4.0.0</modelVersion>
     <artifactId>httpserver</artifactId>
     <name>openo/commontosca/catalog/httpserver</name>
     <packaging>pom</packaging>
-    
+
     <properties>
         <tomcat.version>7.0.62</tomcat.version>
         <packagename>http-server</packagename>
     </properties>
-    
+
     <build>
         <plugins>
             <plugin>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>unpack-tomcat</id>
-                        <phase>package</phase>
+                        <id>unpack-tomcat-to-temporary-dir</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.apache.tomcat</groupId>
+                                    <artifactId>tomcat</artifactId>
+                                    <type>zip</type>
+                                    <outputDirectory>target/tomcat</outputDirectory>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-tomcat-resources</id>
+                        <phase>process-resources</phase>
                         <goals>
-                            <goal>unpack-dependencies</goal>
+                            <goal>copy-resources</goal>
                         </goals>
                         <configuration>
-                            <includeGroupIds>org.apache.tomcat</includeGroupIds>
-                            <includeArtifactIds>tomcat</includeArtifactIds>
-                            <outputDirectory>
-                                target/assembly/
-                            </outputDirectory>
+                            <outputDirectory>${project.build.directory}/assembly/tomcat</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/target/tomcat/apache-tomcat-${tomcat.version}</directory>
+                                    <filtering>false</filtering>
+                                    <includes>
+                                        <include>**/*</include>
+                                    </includes>
+                                </resource>
+                            </resources>
                         </configuration>
                     </execution>
                 </executions>
@@ -66,9 +94,6 @@
                         </goals>
                         <configuration>
                             <tasks name="${project.artifactId}">
-                                <move todir="target/assembly/tomcat">
-                                    <fileset dir="target/assembly/apache-tomcat-${tomcat.version}"/>
-                                </move>
                                 <copydir src="src/main/assembly/" dest="target/assembly"/>
                                 <zip destfile="target/${packagename}-${project.version}.zip" update="true">
                                     <zipfileset dir="target/assembly" includes="**" />