39c36bd33b24d8ac5a54fae13bff61688d060053
[vnfsdk/refrepo.git] / vnfmarket-be / deployment / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   Copyright (c) 2017, Huawei Technologies Co., Ltd.
4  
5   Licensed under the Apache License, Version 2.0 (the "License");
6   you may not use this file except in compliance with the License.
7   You may obtain a copy of the License at
8  
9       http://www.apache.org/licenses/LICENSE-2.0
10  
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16 -->
17 <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">
18     <modelVersion>4.0.0</modelVersion>
19    <parent>
20         <groupId>org.openo.vnf-sdk.marketplace</groupId>
21         <artifactId>vnf-sdk-marketplace-core-parent</artifactId>
22         <version>1.1.0-SNAPSHOT</version>
23     </parent>
24
25     <artifactId>vnf-sdk-marketplace-deployment</artifactId>
26     <name>vnf-sdk-marketplace/deployment</name>
27     <packaging>pom</packaging>
28
29     <properties>
30         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31     </properties>
32
33     <build>
34         <pluginManagement>
35             <plugins>
36                 <plugin>
37                     <groupId>org.codehaus.gmaven</groupId>
38                     <artifactId>groovy-maven-plugin</artifactId>
39                     <version>2.0</version>
40                 </plugin>
41             </plugins>
42         </pluginManagement>
43         <plugins>
44             <plugin>
45                 <groupId>org.codehaus.gmaven</groupId>
46                 <artifactId>gmaven-plugin</artifactId>
47                 <version>1.5</version>
48                 <executions>
49                     <execution>
50                         <id>VnfSdkMarketplace package</id>
51                         <phase>package</phase>
52                         <goals>
53                             <goal>execute</goal>
54                         </goals>
55                         <configuration>
56                             <source>
57                                 System.out.println("******** Going to make release zip ********")
58
59                                 deployFolder = "${project.build.directory}/deployoutput"
60                                 deployUnzip = "${project.build.directory}/deployunzip"
61                                 outfileName = "VnfSdkMarketplace-.${project.version}.zip"
62
63                                 ant.delete(dir: "${deployFolder}")
64                                 ant.mkdir(dir: "${deployFolder}")
65
66                                 ant.delete(dir: "${deployUnzip}")
67                                 ant.mkdir(dir: "${deployUnzip}")
68
69                                 ant.mkdir(dir: "${deployUnzip}/webapps/ROOT")
70                                 ant.mkdir(dir: "${deployUnzip}/webapps/openoui#marketplace#v1")
71
72                                 ant.copy(todir: "${deployUnzip}") {
73                                 fileset(dir: "${basedir}/src/main/release"){
74                                 exclude(name: "**/.gitignore")
75                                 }
76                                 }
77
78                                 ant.copy(todir: "${deployUnzip}/webapps/ROOT") {
79                                 fileset(dir: "${project.build.directory}/../../vnf-sdk-marketplace/target/ROOT")
80                                 }
81
82                                 ant.zip(destfile: "${deployFolder}/${outfileName}") {
83                                 fileset(dir: "${deployUnzip}")
84                                 }
85                                 System.out.println("******** completed. ************")
86                             </source>
87                         </configuration>
88                     </execution>
89                 </executions>
90             </plugin>
91              <plugin>
92                 <groupId>org.codehaus.mojo</groupId>
93                 <artifactId>build-helper-maven-plugin</artifactId>
94                 <executions>
95                     <execution>
96                         <id>attach-artifacts</id>
97                         <phase>package</phase>
98                         <goals>
99                             <goal>attach-artifact</goal>
100                         </goals>
101                         <configuration>
102                             <artifacts>
103                                 <artifact>
104                                     <file>${project.build.directory}/deployoutput/VnfSdkMarketplace-.${project.version}.zip</file>
105                                     <type>zip</type>
106                                 </artifact>
107                             </artifacts>
108                         </configuration>
109                     </execution>
110                 </executions>
111             </plugin>
112         </plugins>
113     </build>
114 </project>