b502b36b9af8085d8adab8a14ac6264e2111af6d
[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     <dependency>
100         <groupId>org.openo.common-services.microservice-bus</groupId>
101         <artifactId>eag-openresty-ext</artifactId>
102         <type>zip</type>
103         <version>${project.version}</version>
104         <optional>true</optional>
105     </dependency>
106
107
108   </dependencies>
109         <build>
110
111         <plugins>
112     <plugin>
113       <artifactId>maven-resources-plugin</artifactId>
114       <executions>
115         <execution>
116             <id>copy-resources-dockerfile</id>
117             <phase>prepare-package</phase>
118             <goals>
119               <goal>copy-resources</goal>
120             </goals>
121             <configuration>
122               <outputDirectory>${version.output}</outputDirectory>
123               <includeEmptyDirs>true</includeEmptyDirs>
124               <resources>
125                 <resource>
126                   <directory>${dockerFileDir}</directory>
127                   <filtering>false</filtering>
128                   <includes>
129                     <include>**/*</include>
130                   </includes>
131                 </resource>
132               </resources>
133               <overwrite>true</overwrite>
134             </configuration>
135         </execution>
136         <execution>
137           <id>copy-msb-resources-${linux64id}</id>
138           <phase>prepare-package</phase>
139           <goals>
140             <goal>copy-resources</goal>
141           </goals>
142           <configuration>
143             <outputDirectory>${linux64outputdir}</outputDirectory>
144                       <includeEmptyDirs>true</includeEmptyDirs>
145             <resources>
146               <resource>
147                 <directory>src/assembly/resource/</directory>
148                 <filtering>false</filtering>
149                 <includes>
150                   <include>**/*</include>
151                 </includes>
152                 <excludes>
153                   <exclude>**/*.bat</exclude>
154                 </excludes>
155               </resource>
156             </resources>
157             <overwrite>true</overwrite>
158           </configuration>
159         </execution>
160
161             <execution>
162           <id>copy-msb-resources-${win64id}</id>
163           <phase>prepare-package</phase>
164           <goals>
165             <goal>copy-resources</goal>
166           </goals>
167           <configuration>
168             <outputDirectory>${win64outputdir}</outputDirectory>
169                       <includeEmptyDirs>true</includeEmptyDirs>
170             <resources>
171               <resource>
172                 <directory>src/assembly/resource/</directory>
173                 <filtering>false</filtering>
174                 <includes>
175                   <include>**/*</include>
176                 </includes>
177                 <excludes>
178                   <exclude>**/*.sh</exclude>
179                 </excludes>
180               </resource>
181             </resources>
182             <overwrite>true</overwrite>
183           </configuration>
184         </execution>
185       </executions>
186     </plugin>
187
188     <plugin>
189       <groupId>org.apache.maven.plugins</groupId>
190       <artifactId>maven-dependency-plugin</artifactId>
191       <executions>
192         <execution>
193             <id>unpacktolinux64</id>
194             <goals>
195                 <goal>unpack</goal>
196             </goals>
197             <phase>prepare-package</phase>
198             <configuration>
199               <artifactItems>
200                   <artifactItem>
201                     <groupId>org.openo.common-services.microservice-bus</groupId>
202                     <artifactId>apiroute-standalone</artifactId>
203                     <type>zip</type>
204                   </artifactItem>
205                   <artifactItem>
206                     <groupId>org.openo.common-services.microservice-bus</groupId>
207                     <artifactId>redis</artifactId>
208                     <type>tar.gz</type>
209                     <classifier>linux64</classifier>
210                   </artifactItem>
211                   <artifactItem>
212                     <groupId>org.openo.common-services.microservice-bus</groupId>
213                     <artifactId>redis-ext</artifactId>
214                     <type>zip</type>
215                   </artifactItem>
216                   <artifactItem>
217                     <groupId>org.openo.common-services.microservice-bus</groupId>
218                     <artifactId>openresty</artifactId>
219                     <type>tar.gz</type>
220                     <classifier>linux64</classifier>
221                   </artifactItem>
222                   <artifactItem>
223                     <groupId>org.openo.common-services.microservice-bus</groupId>
224                     <artifactId>openresty-ext</artifactId>
225                     <type>zip</type>
226                   </artifactItem>
227               </artifactItems>
228               <excludes>**/*.bat,*.cmd</excludes>
229               <outputDirectory>${linux64outputdir}</outputDirectory>
230               <overWriteReleases>false</overWriteReleases>
231               <overWriteSnapshots>true</overWriteSnapshots>
232               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
233             </configuration>
234         </execution>
235
236         <execution>
237             <id>eag-unpacktolinux64</id>
238             <goals>
239                 <goal>unpack</goal>
240             </goals>
241             <phase>prepare-package</phase>
242             <configuration>
243               <artifactItems>
244                   <artifactItem>
245                     <groupId>org.openo.common-services.microservice-bus</groupId>
246                     <artifactId>openresty</artifactId>
247                     <type>tar.gz</type>
248                     <classifier>linux64</classifier>
249                   </artifactItem>
250                   <artifactItem>
251                     <groupId>org.openo.common-services.microservice-bus</groupId>
252                     <artifactId>eag-openresty-ext</artifactId>
253                     <type>zip</type>
254                   </artifactItem>
255               </artifactItems>
256               <excludes>**/*.bat,*.cmd</excludes>
257               <outputDirectory>${linux64outputdir}/eag</outputDirectory>
258               <overWriteReleases>false</overWriteReleases>
259               <overWriteSnapshots>true</overWriteSnapshots>
260               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
261             </configuration>
262         </execution>
263
264         <execution>
265             <id>unpacktowin64</id>
266             <goals>
267                 <goal>unpack</goal>
268             </goals>
269             <phase>prepare-package</phase>
270             <configuration>
271               <artifactItems>
272                   <artifactItem>
273                     <groupId>org.openo.common-services.microservice-bus</groupId>
274                     <artifactId>apiroute-standalone</artifactId>
275                     <type>zip</type>
276                   </artifactItem>
277                   <artifactItem>
278                     <groupId>org.openo.common-services.microservice-bus</groupId>
279                     <artifactId>redis</artifactId>
280                     <type>zip</type>
281                     <classifier>win64</classifier>
282                   </artifactItem>
283                   <artifactItem>
284                     <groupId>org.openo.common-services.microservice-bus</groupId>
285                     <artifactId>redis-ext</artifactId>
286                     <type>zip</type>
287                   </artifactItem>
288                   <artifactItem>
289                     <groupId>org.openo.common-services.microservice-bus</groupId>
290                     <artifactId>openresty</artifactId>
291                     <type>zip</type>
292                     <classifier>win64</classifier>
293                   </artifactItem>
294                   <artifactItem>
295                     <groupId>org.openo.common-services.microservice-bus</groupId>
296                     <artifactId>openresty-ext</artifactId>
297                     <type>zip</type>
298                   </artifactItem>
299               </artifactItems>
300               <excludes>*.sh,*/*.sh,*/*/*.sh</excludes>
301               <outputDirectory>${win64outputdir}</outputDirectory>
302               <overWriteReleases>false</overWriteReleases>
303               <overWriteSnapshots>true</overWriteSnapshots>
304               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
305             </configuration>
306         </execution>
307
308         <execution>
309             <id>eag-unpacktowin64</id>
310             <goals>
311                 <goal>unpack</goal>
312             </goals>
313             <phase>prepare-package</phase>
314             <configuration>
315               <artifactItems>
316                   <artifactItem>
317                     <groupId>org.openo.common-services.microservice-bus</groupId>
318                     <artifactId>openresty</artifactId>
319                     <type>zip</type>
320                     <classifier>win64</classifier>
321                   </artifactItem>
322                   <artifactItem>
323                     <groupId>org.openo.common-services.microservice-bus</groupId>
324                     <artifactId>eag-openresty-ext</artifactId>
325                     <type>zip</type>
326                   </artifactItem>
327               </artifactItems>
328               <excludes>*.sh,*/*.sh,*/*/*.sh</excludes>
329               <outputDirectory>${win64outputdir}/eag</outputDirectory>
330               <overWriteReleases>false</overWriteReleases>
331               <overWriteSnapshots>true</overWriteSnapshots>
332               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
333             </configuration>
334         </execution>
335       </executions>
336     </plugin>
337
338     <plugin>
339       <groupId>org.apache.maven.plugins</groupId>
340       <artifactId>maven-antrun-plugin</artifactId>
341       <executions>
342
343         <execution>
344           <id>prepare-eag-openresty-linux</id>
345           <phase>prepare-package</phase>
346           <goals>
347             <goal>run</goal>
348           </goals>
349           <configuration>
350             <target>
351               <copy todir="${linux64outputdir}/eag/">
352                 <fileset dir="${linux64outputdir}/eag/openresty"/>
353               </copy>
354               <delete 
355                 dir="${linux64outputdir}/eag/openresty"
356                 includeemptydirs="true"/>
357             </target>          
358           </configuration>
359         </execution>
360
361         <execution>
362           <id>prepare-eag-openresty-win</id>
363           <phase>prepare-package</phase>
364           <goals>
365             <goal>run</goal>
366           </goals>
367           <configuration>
368             <target>
369               <copy todir="${win64outputdir}/eag/">
370                 <fileset dir="${win64outputdir}/eag/openresty"/>
371               </copy>
372               <delete 
373                 dir="${win64outputdir}/eag/openresty"
374                 includeemptydirs="true"/>
375             </target>          
376           </configuration>
377         </execution>
378
379
380         <execution>
381             <id>distribution</id>
382             <phase>package</phase>
383             <goals>
384                 <goal>run</goal>
385             </goals>
386             <configuration>
387                 <target name="distribution">
388                     <tar destfile="${version.output}/${packageid}-${project.version}-linux64.tar.gz" longfile="posix" compression="gzip">
389                         <tarfileset dir="target/assembly/linux64" filemode="0644" dirmode="0755">
390                             <exclude name="**/*.sh"/>
391                             <exclude name="openresty/nginx/sbin/nginx"/>
392                             <exclude name="redis/redis-*"/>
393                         </tarfileset>
394                         <tarfileset dir="target/assembly/linux64" filemode="0755" dirmode="0755">
395                             <include name="**/*.sh"/>
396                             <include name="openresty/nginx/sbin/nginx"/>
397                             <include name="redis/redis-*"/>
398                         </tarfileset>
399                     </tar>
400                     <attachartifact file="${version.output}/${packageid}-${project.version}-linux64.tar.gz" classifier="linux64" type="tar.gz"/>
401
402
403                       <zip destfile="${version.output}/${packageid}-${project.version}-win64.zip" update="true">
404                       <zipfileset dir="target/assembly/win64" includes="**"/>
405                     </zip>
406                     <attachartifact file="${version.output}/${packageid}-${project.version}-win64.zip" classifier="win64" type="zip"/>
407                 </target>
408             </configuration>
409         </execution>
410       </executions>
411     </plugin>
412         </plugins>
413         </build>
414
415 </project>