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