migrate discovery source codes from OPEN-O
[msb/discovery.git] / distributions / msb-discovery / pom.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4     Copyright 2016 ZTE, Inc. and others.
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 -->
19 <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">
20   <parent>
21     <groupId>org.onap.msb.discovery.distributions</groupId>
22     <artifactId>distributions-parent</artifactId>
23     <version>0.0.1-SNAPSHOT</version>
24   </parent>
25   <modelVersion>4.0.0</modelVersion>
26   <groupId>org.onap.msb.discovery.distributions</groupId>
27   <artifactId>msb-discovery</artifactId>
28   <version>0.0.1-SNAPSHOT</version>
29   <name>onap/msb/discovery/distributions/msb-discovery</name>
30   <packaging>pom</packaging>
31
32   <properties>
33
34     <openresty.version>1.11.2.2</openresty.version>
35     <packageid>msb-discovery</packageid>
36
37     <version.output>target/version</version.output>
38     <html.dir>openresty/nginx/html</html.dir>
39   </properties>
40
41   <dependencies>
42
43         <dependency>
44          <groupId>org.openresty.centos.6</groupId>
45          <artifactId>openresty</artifactId>
46          <version>${openresty.version}</version>
47          <type>tar.gz</type>
48     </dependency>
49
50      <dependency>
51       <groupId>org.onap.msb.discovery</groupId>
52       <artifactId>nginx-ext-consul</artifactId>
53       <type>zip</type>
54       <version>${project.version}</version>
55       <optional>true</optional>
56     </dependency>
57     <dependency>
58       <groupId>org.onap.msb.discovery.sdclient</groupId>
59       <artifactId>discovery-standalone</artifactId>
60       <type>zip</type>
61       <version>${project.version}</version>
62       <optional>true</optional>
63     </dependency>    
64
65   </dependencies>   
66
67
68   <build>    
69     <plugins>
70       <plugin>
71         <artifactId>maven-resources-plugin</artifactId>
72         <executions>
73           <execution>
74             <id>copy-resources-dockerfile</id>                 
75             <phase>process-resources</phase>
76             <goals>
77               <goal>copy-resources</goal>
78             </goals>
79             <configuration>            
80               <outputDirectory>${version.output}</outputDirectory>
81               <includeEmptyDirs>true</includeEmptyDirs>
82               <resources>     
83                 <resource>
84                   <directory>${dockerFileDir}</directory>
85                   <filtering>false</filtering>
86                   <includes>
87                     <include>**/*</include>
88                   </includes>
89                 </resource>  
90               </resources>
91               <overwrite>true</overwrite>
92             </configuration>
93           </execution>
94   
95           <execution>
96             <id>copy-resources-linux64</id>                 
97             <phase>process-resources</phase>
98             <goals>
99               <goal>copy-resources</goal>
100             </goals>
101             <configuration>            
102               <outputDirectory>${linux64outputdir}</outputDirectory>
103               <includeEmptyDirs>true</includeEmptyDirs>
104               <resources>     
105                 <resource>
106                   <directory>src/assembly/resources</directory>
107                   <filtering>false</filtering>
108                   <includes>
109                     <include>**/*</include>
110                   </includes>
111                   <excludes>
112                     <exclude>**/*.bat</exclude>
113                   </excludes>
114                 </resource>  
115               </resources>
116               <overwrite>true</overwrite>
117             </configuration>
118           </execution>
119         </executions>
120       </plugin>
121
122       <plugin>
123         <groupId>org.apache.maven.plugins</groupId>
124         <artifactId>maven-dependency-plugin</artifactId>
125         <executions>      
126           <execution>
127             <id>unpack-nginx</id>
128             <goals>
129               <goal>unpack</goal>
130             </goals>
131             <!--解压顺序,在最前面-->
132             <phase>generate-resources</phase>
133             <configuration>
134               <artifactItems>   
135                                 <artifactItem>
136                                         <groupId>org.openresty.centos.6</groupId>
137                     <artifactId>openresty</artifactId>
138                     <type>tar.gz</type>
139                     <outputDirectory>${linux64outputdir}</outputDirectory>         
140                 </artifactItem>
141               </artifactItems>
142               <overWriteReleases>false</overWriteReleases>
143               <overWriteSnapshots>true</overWriteSnapshots>
144               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
145             </configuration>
146           </execution>          
147         </executions>
148       </plugin> 
149
150       <plugin>
151         <groupId>com.coderplus.maven.plugins</groupId>
152         <artifactId>copy-rename-maven-plugin</artifactId>
153         <version>1.0.1</version>
154         <executions>
155           <execution>
156             <id>rename-nginx-dir</id>
157             <phase>process-resources</phase>
158             <goals>
159               <goal>rename</goal>
160             </goals>
161             <configuration>
162               <sourceFile>${linux64outputdir}/openresty-${openresty.version}</sourceFile>
163               <destinationFile>${linux64outputdir}/openresty</destinationFile>
164             </configuration>
165           </execution>
166         </executions>
167       </plugin> 
168
169
170       <plugin>
171         <groupId>org.apache.maven.plugins</groupId>
172         <artifactId>maven-dependency-plugin</artifactId>
173         <executions>      
174           <execution>
175             <id>unpacktolinux64</id>
176             <goals>
177               <goal>unpack</goal>
178             </goals>
179             <phase>prepare-package</phase>
180             <configuration>
181               <artifactItems>   
182                 <artifactItem>
183                   <groupId>org.onap.msb.discovery</groupId>
184                   <artifactId>nginx-ext-consul</artifactId>
185                   <type>zip</type>            
186                 </artifactItem> 
187                 <artifactItem>
188                   <groupId>org.onap.msb.discovery.sdclient</groupId>
189                   <artifactId>discovery-standalone</artifactId>
190                   <type>zip</type>
191                 </artifactItem>                       
192               </artifactItems>
193               <excludes>**/*.bat,*.cmd,META-INF/**</excludes>
194               <outputDirectory>${linux64outputdir}</outputDirectory>
195               <overWriteReleases>false</overWriteReleases>
196               <overWriteSnapshots>true</overWriteSnapshots>
197               <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
198             </configuration>
199           </execution>          
200         </executions>
201       </plugin> 
202
203
204 <plugin>
205   <groupId>org.apache.maven.plugins</groupId>
206   <artifactId>maven-antrun-plugin</artifactId>
207   <executions>
208     <execution>
209       <id>distribution</id>
210       <phase>package</phase>
211       <goals>
212         <goal>run</goal>
213       </goals>
214       <configuration>
215         <target name="distribution">
216           <tar destfile="${version.output}/${packageid}-${project.version}-${classifier.linux64}.tar.gz" longfile="posix" compression="gzip">
217             <tarfileset dir="${linux64outputdir}" prefix="${packageid}" filemode="0644" dirmode="0755">
218               <exclude name="**/*.sh"/>
219               <exclude name="openresty/nginx/sbin/nginx"/>
220             </tarfileset>
221             <tarfileset dir="${linux64outputdir}" prefix="${packageid}" filemode="0755" dirmode="0755">
222               <include name="**/*.sh"/>
223               <include name="openresty/nginx/sbin/nginx"/>
224             </tarfileset>
225           </tar>
226         </target>
227       </configuration>
228     </execution>
229   </executions>
230 </plugin>
231 </plugins>
232 </build>
233
234 </project>
235