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