Issue-id: OCS-9
[msb/apigateway.git] / msb-core / distributions / standalone / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4     Copyright 2016 2015-2016 ZTE, Inc. and others. All rights reserved.
5
6     Licensed under the Apache License, Version 2.0 (the "License");
7     you may not use this file except in compliance with the License.
8     You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12     Unless required by applicable law or agreed to in writing, software
13     distributed under the License is distributed on an "AS IS" BASIS,
14     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15     See the License for the specific language governing permissions and
16     limitations under the License.
17
18         Author: Zhaoxing Meng
19         email: meng.zhaoxing1@zte.com.cn
20
21 -->
22 <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/maven-v4_0_0.xsd">
23     <parent>
24         <groupId>org.openo.common-services.microservice-bus</groupId>
25         <artifactId>distributions-parent</artifactId>
26         <version>1.0.0-SNAPSHOT</version>
27     </parent>
28     <modelVersion>4.0.0</modelVersion>
29     <artifactId>msb-core-standalone</artifactId>
30     <name>openo/msb/msb-core/distributions/standalone</name>
31     <packaging>pom</packaging>
32     <version>1.0.0-SNAPSHOT</version>
33
34     <properties>
35       <packageid>msb-standalone</packageid>
36       <linux64id>linux64</linux64id>
37       <win64id>win64</win64id>
38       <linux64outputdir>target/assembly/${linux64id}</linux64outputdir>
39       <win64outputdir>target/assembly/${win64id}</win64outputdir>
40     </properties>
41
42         <dependencies>
43     <dependency>
44       <groupId>org.openo.common-services.microservice-bus</groupId>
45       <artifactId>apiroute-standalone</artifactId>
46       <version>${project.version}</version>
47       <type>zip</type>
48       <optional>true</optional>
49     </dependency>
50
51     <dependency>
52         <groupId>org.openo.common-services.microservice-bus</groupId>
53         <artifactId>redis</artifactId>
54         <type>zip</type>
55         <classifier>win64</classifier>
56         <version>${project.version}</version>
57         <optional>true</optional>
58     </dependency>
59     <dependency>
60         <groupId>org.openo.common-services.microservice-bus</groupId>
61         <artifactId>redis</artifactId>
62         <type>tar.gz</type>
63         <classifier>linux64</classifier>
64         <version>${project.version}</version>
65         <optional>true</optional>
66     </dependency>
67     <dependency>
68         <groupId>org.openo.common-services.microservice-bus</groupId>
69         <artifactId>redis-ext</artifactId>
70         <type>zip</type>
71         <version>${project.version}</version>
72         <optional>true</optional>
73     </dependency>
74
75     <dependency>
76         <groupId>org.openo.common-services.microservice-bus</groupId>
77         <artifactId>openresty</artifactId>
78         <type>zip</type>
79         <classifier>win64</classifier>
80         <version>${project.version}</version>
81         <optional>true</optional>
82     </dependency>
83     <dependency>
84         <groupId>org.openo.common-services.microservice-bus</groupId>
85         <artifactId>openresty</artifactId>
86         <type>tar.gz</type>
87         <classifier>linux64</classifier>
88         <version>${project.version}</version>
89         <optional>true</optional>
90     </dependency>
91
92     <dependency>
93         <groupId>org.openo.common-services.microservice-bus</groupId>
94         <artifactId>openresty-ext</artifactId>
95         <type>zip</type>
96         <version>${project.version}</version>
97         <optional>true</optional>
98     </dependency>
99
100
101   </dependencies>
102         <build>
103
104         <plugins>
105     <plugin>
106       <artifactId>maven-resources-plugin</artifactId>
107       <executions>
108         <execution>
109             <id>copy-resources-dockerfile</id>
110             <phase>prepare-package</phase>
111             <goals>
112               <goal>copy-resources</goal>
113             </goals>
114             <configuration>
115               <outputDirectory>${version.output}</outputDirectory>
116               <includeEmptyDirs>true</includeEmptyDirs>
117               <resources>
118                 <resource>
119                   <directory>${dockerFileDir}</directory>
120                   <filtering>false</filtering>
121                   <includes>
122                     <include>**/*</include>
123                   </includes>
124                 </resource>
125               </resources>
126               <overwrite>true</overwrite>
127             </configuration>
128         </execution>
129         <execution>
130           <id>copy-msb-resources-${linux64id}</id>
131           <phase>prepare-package</phase>
132           <goals>
133             <goal>copy-resources</goal>
134           </goals>
135           <configuration>
136             <outputDirectory>${linux64outputdir}</outputDirectory>
137                       <includeEmptyDirs>true</includeEmptyDirs>
138             <resources>
139               <resource>
140                 <directory>src/assembly/resource/</directory>
141                 <filtering>false</filtering>
142                 <includes>
143                   <include>**/*</include>
144                 </includes>
145                 <excludes>
146                   <exclude>**/*.bat</exclude>
147                 </excludes>
148               </resource>
149             </resources>
150             <overwrite>true</overwrite>
151           </configuration>
152         </execution>
153
154             <execution>
155           <id>copy-msb-resources-${win64id}</id>
156           <phase>prepare-package</phase>
157           <goals>
158             <goal>copy-resources</goal>
159           </goals>
160           <configuration>
161             <outputDirectory>${win64outputdir}</outputDirectory>
162                       <includeEmptyDirs>true</includeEmptyDirs>
163             <resources>
164               <resource>
165                 <directory>src/assembly/resource/</directory>
166                 <filtering>false</filtering>
167                 <includes>
168                   <include>**/*</include>
169                 </includes>
170                 <excludes>
171                   <exclude>**/*.sh</exclude>
172                 </excludes>
173               </resource>
174             </resources>
175             <overwrite>true</overwrite>
176           </configuration>
177         </execution>
178       </executions>
179     </plugin>
180
181     <plugin>
182       <groupId>org.apache.maven.plugins</groupId>
183       <artifactId>maven-dependency-plugin</artifactId>
184       <executions>
185         <execution>
186             <id>unpacktolinux64</id>
187             <goals>
188                 <goal>unpack</goal>
189             </goals>
190             <phase>prepare-package</phase>
191             <configuration>
192               <artifactItems>
193                   <artifactItem>
194                     <groupId>org.openo.common-services.microservice-bus</groupId>
195                     <artifactId>apiroute-standalone</artifactId>
196                     <type>zip</type>
197                   </artifactItem>
198                   <artifactItem>
199                     <groupId>org.openo.common-services.microservice-bus</groupId>
200                     <artifactId>redis</artifactId>
201                     <type>tar.gz</type>
202                     <classifier>linux64</classifier>
203                   </artifactItem>
204                   <artifactItem>
205                     <groupId>org.openo.common-services.microservice-bus</groupId>
206                     <artifactId>redis-ext</artifactId>
207                     <type>zip</type>
208                   </artifactItem>
209                   <artifactItem>
210                     <groupId>org.openo.common-services.microservice-bus</groupId>
211                     <artifactId>openresty</artifactId>
212                     <type>tar.gz</type>
213                     <classifier>linux64</classifier>
214                   </artifactItem>
215                   <artifactItem>
216                     <groupId>org.openo.common-services.microservice-bus</groupId>
217                     <artifactId>openresty-ext</artifactId>
218                     <type>zip</type>
219                   </artifactItem>
220               </artifactItems>
221               <excludes>**/*.bat,*.cmd</excludes>
222               <outputDirectory>${linux64outputdir}</outputDirectory>
223               <overWriteReleases>false</overWriteReleases>
224               <overWriteSnapshots>true</overWriteSnapshots>
225               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
226             </configuration>
227         </execution>
228         <execution>
229             <id>unpacktowin64</id>
230             <goals>
231                 <goal>unpack</goal>
232             </goals>
233             <phase>prepare-package</phase>
234             <configuration>
235               <artifactItems>
236                   <artifactItem>
237                     <groupId>org.openo.common-services.microservice-bus</groupId>
238                     <artifactId>apiroute-standalone</artifactId>
239                     <type>zip</type>
240                   </artifactItem>
241                   <artifactItem>
242                     <groupId>org.openo.common-services.microservice-bus</groupId>
243                     <artifactId>redis</artifactId>
244                     <type>zip</type>
245                     <classifier>win64</classifier>
246                   </artifactItem>
247                   <artifactItem>
248                     <groupId>org.openo.common-services.microservice-bus</groupId>
249                     <artifactId>redis-ext</artifactId>
250                     <type>zip</type>
251                   </artifactItem>
252                   <artifactItem>
253                     <groupId>org.openo.common-services.microservice-bus</groupId>
254                     <artifactId>openresty</artifactId>
255                     <type>zip</type>
256                     <classifier>win64</classifier>
257                   </artifactItem>
258                   <artifactItem>
259                     <groupId>org.openo.common-services.microservice-bus</groupId>
260                     <artifactId>openresty-ext</artifactId>
261                     <type>zip</type>
262                   </artifactItem>
263               </artifactItems>
264               <excludes>*.sh,*/*.sh,*/*/*.sh</excludes>
265               <outputDirectory>${win64outputdir}</outputDirectory>
266               <overWriteReleases>false</overWriteReleases>
267               <overWriteSnapshots>true</overWriteSnapshots>
268               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
269             </configuration>
270         </execution>
271       </executions>
272     </plugin>
273
274     <plugin>
275       <groupId>org.apache.maven.plugins</groupId>
276       <artifactId>maven-antrun-plugin</artifactId>
277       <executions>
278         <execution>
279             <id>distribution</id>
280             <phase>package</phase>
281             <goals>
282                 <goal>run</goal>
283             </goals>
284             <configuration>
285                 <target name="distribution">
286                     <tar destfile="${version.output}/${packageid}-${project.version}-linux64.tar.gz" longfile="posix" compression="gzip">
287                         <tarfileset dir="target/assembly/linux64" filemode="0644" dirmode="0755">
288                             <exclude name="**/*.sh"/>
289                             <exclude name="openresty/nginx/sbin/nginx"/>
290                             <exclude name="redis/redis-*"/>
291                         </tarfileset>
292                         <tarfileset dir="target/assembly/linux64" filemode="0755" dirmode="0755">
293                             <include name="**/*.sh"/>
294                             <include name="openresty/nginx/sbin/nginx"/>
295                             <include name="redis/redis-*"/>
296                         </tarfileset>
297                     </tar>
298                     <attachartifact file="${version.output}/${packageid}-${project.version}-linux64.tar.gz" classifier="linux64" type="tar.gz"/>
299
300
301                       <zip destfile="${version.output}/${packageid}-${project.version}-win64.zip" update="true">
302                       <zipfileset dir="target/assembly/win64" includes="**"/>
303                     </zip>
304                     <attachartifact file="${version.output}/${packageid}-${project.version}-win64.zip" classifier="win64" type="zip"/>
305                 </target>
306             </configuration>
307         </execution>
308       </executions>
309     </plugin>
310         </plugins>
311         </build>
312
313 </project>
314