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