Merge "Add api docs for MSB"
[msb/apigateway.git] / apiroute / apiroute-service / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
3         Licensed under the Apache License, Version 2.0 (the "License"); you may not
4         use this file except in compliance with the License. You may obtain a copy
5         of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
6         by applicable law or agreed to in writing, software distributed under the
7         License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8         OF ANY KIND, either express or implied. See the License for the specific
9         language governing permissions and limitations under the License. -->
10 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12         <parent>
13                 <groupId>org.onap.msb.apigateway.apiroute</groupId>
14                 <artifactId>apiroute-parent</artifactId>
15                 <version>1.0.0-SNAPSHOT</version>
16         </parent>
17         <modelVersion>4.0.0</modelVersion>
18         <groupId>org.onap.msb.apigateway.apiroute</groupId>
19         <artifactId>apiroute-service</artifactId>
20         <name>onap/msb/apigateway/apiroute/apiroute-service</name>
21         <packaging>jar</packaging>
22         <version>1.0.0-SNAPSHOT</version>
23
24
25         <dependencies>
26                 <dependency>
27                         <groupId>io.dropwizard</groupId>
28                         <artifactId>dropwizard-core</artifactId>
29                 </dependency>
30                 <dependency>
31                         <groupId>io.dropwizard</groupId>
32                         <artifactId>dropwizard-assets</artifactId>
33                 </dependency>
34                 <dependency>
35                         <groupId>io.dropwizard</groupId>
36                         <artifactId>dropwizard-client</artifactId>
37                 </dependency>
38                 <dependency>
39                         <groupId>io.swagger</groupId>
40                         <artifactId>swagger-jersey2-jaxrs</artifactId>
41                         <scope>compile</scope>
42                 </dependency>
43                 <!-- add by wangyg:增加redis的java客户端jedis依赖 -->
44                 <dependency>
45                         <groupId>redis.clients</groupId>
46                         <artifactId>jedis</artifactId>
47                 </dependency>
48                 <dependency>
49                         <groupId>org.projectlombok</groupId>
50                         <artifactId>lombok</artifactId>
51                 </dependency>
52
53                 <dependency>
54                         <groupId>junit</groupId>
55                         <artifactId>junit</artifactId>
56                         <scope>test</scope>
57                 </dependency>
58                 <dependency>
59                         <groupId>org.powermock</groupId>
60                         <artifactId>powermock-module-junit4</artifactId>
61                         <scope>test</scope>
62                 </dependency>
63
64                 <dependency>
65                         <groupId>org.powermock</groupId>
66                         <artifactId>powermock-api-mockito</artifactId>
67                         <scope>test</scope>
68                 </dependency>
69                 <dependency>
70                         <groupId>com.orbitz.consul</groupId>
71                         <artifactId>consul-client</artifactId>
72                 </dependency>
73
74                 <dependency>
75                         <groupId>com.fasterxml.jackson.core</groupId>
76                         <artifactId>jackson-databind</artifactId>
77                 </dependency>
78
79                 <dependency>
80                         <groupId>com.fasterxml.jackson.core</groupId>
81                         <artifactId>jackson-core</artifactId>
82                 </dependency>
83
84                 <dependency>
85                         <groupId>com.fasterxml.jackson.core</groupId>
86                         <artifactId>jackson-annotations</artifactId>
87                 </dependency>
88
89                 <dependency>
90                         <groupId>org.apache.httpcomponents</groupId>
91                         <artifactId>httpasyncclient</artifactId>
92                 </dependency>
93
94                 <dependency>
95                         <groupId>org.immutables</groupId>
96                         <artifactId>value</artifactId>
97                         <scope>compile</scope>
98                 </dependency>
99
100                 <dependency>
101                         <groupId>com.fiftyonred</groupId>
102                         <artifactId>mock-jedis</artifactId>
103                 </dependency>
104
105                 <dependency>
106         <groupId>commons-io</groupId>
107         <artifactId>commons-io</artifactId>
108       </dependency>
109
110           <dependency>
111           <groupId>org.onap.msb.swagger-sdk</groupId>
112           <artifactId>swagger-sdk</artifactId>
113           <version>1.0.0-SNAPSHOT</version>
114           <exclusions>
115               <exclusion>
116                   <groupId>org.slf4j</groupId>
117                   <artifactId>slf4j-log4j12</artifactId>
118               </exclusion>
119           </exclusions>
120       </dependency>
121
122         </dependencies>
123         <build>
124                 <plugins>
125                         <plugin>
126                                 <groupId>org.apache.maven.plugins</groupId>
127                                 <artifactId>maven-jar-plugin</artifactId>
128                                 <version>2.4</version>
129                                 <configuration>
130                                         <archive>
131                                                 <manifest>
132                                                         <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
133                                                 </manifest>
134                                         </archive>
135                                 </configuration>
136                         </plugin>
137                         <plugin>
138                                 <groupId>org.apache.maven.plugins</groupId>
139                                 <artifactId>maven-shade-plugin</artifactId>
140                                 <version>2.3</version>
141                                 <configuration>
142                                         <createDependencyReducedPom>true</createDependencyReducedPom>
143                                         <filters>
144                                                 <filter>
145                                                         <artifact>*:*</artifact>
146                                                         <excludes>
147                                                                 <exclude>META-INF/*.SF</exclude>
148                                                                 <exclude>META-INF/*.DSA</exclude>
149                                                                 <exclude>META-INF/*.RSA</exclude>
150                                                         </excludes>
151                                                 </filter>
152                                         </filters>
153                                 </configuration>
154                                 <executions>
155                                         <execution>
156                                                 <phase>package</phase>
157                                                 <goals>
158                                                         <goal>shade</goal>
159                                                 </goals>
160                                                 <configuration>
161                                                         <transformers>
162                                                                 <transformer
163                                                                         implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
164                                                                 <transformer
165                                                                         implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
166                                                                         <mainClass>org.onap.msb.apiroute.ApiRouteApp</mainClass>
167                                                                 </transformer>
168                                                         </transformers>
169                                                 </configuration>
170                                         </execution>
171                                 </executions>
172                         </plugin>
173
174                         <!-- JSON -->
175                          <plugin>
176                                         <groupId>org.codehaus.mojo</groupId>
177                                         <artifactId>properties-maven-plugin</artifactId>
178                                         <version>1.0.0</version>
179                                           <executions>
180                                                   <execution>
181                                                         <phase>initialize</phase>
182                                                         <goals>
183                                                           <goal>read-project-properties</goal>
184                                                         </goals>
185                                                         <configuration>
186                                                           <files>
187                                                                 <file>${basedir}/src/main/resources/swagger.properties</file>
188                                                           </files>
189                                                         </configuration>
190                                                   </execution>
191                                         </executions>
192                                 </plugin>
193                                 <plugin>
194                                         <groupId>com.github.kongchen</groupId>
195                                         <artifactId>swagger-maven-plugin</artifactId>
196                                         <version>3.1.4</version>
197                                         <configuration>
198                                                 <apiSources>
199                                                   <apiSource>
200                                                                 <locations>${api-rest-package}</locations>
201                                                                 <schemes>http,https</schemes>
202                                                                 <host>${api-host-ip}:${api-host-port}</host>
203                                                                 <basePath>${api-base-path}</basePath>
204                                                                 <info>
205                                                                         <title>${api-title}</title>
206                                                                         <version>${api-version}</version>
207                                                                         <description>${api-description}</description>
208                                                                         <license>
209                                                                                 <name>${api-license}</name>
210                                                                         </license>
211                                                                 </info>
212                                                                 <swaggerDirectory>${basedir}/src/main/resources</swaggerDirectory>
213                                                         </apiSource>
214                                                 </apiSources>
215                                         </configuration>
216                                         <executions>
217                                                 <execution>
218                                                         <phase>compile</phase>
219                                                         <goals>
220                                                                 <goal>generate</goal>
221                                                         </goals>
222                                                 </execution>
223                                         </executions>
224                                 </plugin>
225                                 <plugin>
226                                         <groupId>org.apache.maven.plugins</groupId>
227                                         <artifactId>maven-install-plugin</artifactId>
228                                         <version>2.3.1</version>
229                                         <executions>
230                                                 <execution>
231                                                         <id>install-file-id</id>
232                                                         <phase>install</phase>
233                                                         <goals>
234                                                                 <goal>install-file</goal>
235                                                         </goals>
236                                                         <configuration>
237                                                                 <file>${basedir}/src/main/resources/swagger.json</file>
238                                                                 <groupId>${project.groupId}</groupId>
239                                                                 <artifactId>${project.artifactId}-swagger-schema</artifactId>
240                                                                 <version>${project.version}</version>
241                                                                 <packaging>json</packaging>
242                                                         </configuration>
243                                                 </execution>
244                                         </executions>
245                                 </plugin>
246
247                                 <!-- SDK -->
248                                 <plugin>
249                                 <groupId>org.apache.maven.plugins</groupId>
250                                 <artifactId>maven-antrun-plugin</artifactId>
251                                 <version>1.8</version>
252                                 <executions>
253                                   <execution>
254                                         <phase>initialize</phase>
255                                         <id>ant-create-script</id>
256                                         <configuration>
257                                           <exportAntProperties>true</exportAntProperties>
258                                           <tasks>
259                                                 <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath"/>
260                                                 <condition property="is_windows" value="true">
261                                                   <os family="windows"/>
262                                                 </condition>
263                                                 <condition property="isLinux" value="true">
264                                                   <os family="unix"/>
265                                                 </condition>
266                                                 <if>
267                                                   <equals arg1="${is_windows}" arg2="true"/>
268                                                   <then>
269                                                         <property name="swagger.sdk.script.file" value="generated-source-script.bat"/>
270                                                         <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
271                                                         <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
272                                                   </then>
273                                                   <else>
274                                                         <property name="swagger.sdk.script.file" value="generated-source-script.sh"/>
275                                                         <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
276                                                         <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
277                                                         <chmod file="${project.build.directory}${file.separator}generated-source-script.sh" perm="755"/>
278                                                   </else>
279                                                 </if>
280                                           </tasks>
281                                         </configuration>
282                                         <goals>
283                                           <goal>run</goal>
284                                         </goals>
285                                   </execution>
286                                 </executions>
287                                 <dependencies>
288                                   <dependency>
289                                         <groupId>ant-contrib</groupId>
290                                         <artifactId>ant-contrib</artifactId>
291                                         <version>1.0b3</version>
292                                         <exclusions>
293                                           <exclusion>
294                                                 <artifactId>ant</artifactId>
295                                                 <groupId>ant</groupId>
296                                           </exclusion>
297                                         </exclusions>
298                                   </dependency>
299                                 </dependencies>
300                           </plugin>
301                           <plugin>
302                                 <groupId>io.swagger</groupId>
303                                 <artifactId>swagger-codegen-maven-plugin</artifactId>
304                                 <version>2.2.1</version>
305                                 <executions>
306                                   <execution>
307                                         <goals>
308                                           <goal>generate</goal>
309                                         </goals>
310                                         <configuration>
311                                           <inputSpec>${basedir}/src/main/resources/swagger.json</inputSpec>
312                                           <output>${project.build.directory}/generated-sources</output>
313                                           <language>java</language>
314                                           <configOptions>
315                                                 <dateLibrary>joda</dateLibrary>
316                                           </configOptions>
317                                           <library>jersey2</library>
318                                           <groupId>${project.groupId}</groupId>
319                                           <artifactId>${project.artifactId}-java-sdk</artifactId>
320                                           <artifactVersion>${project.version}</artifactVersion>
321                                           <modelPackage>${project.groupId}.${project.artifactId}.client.model</modelPackage>
322                                           <apiPackage>${project.groupId}.${project.artifactId}.client.api</apiPackage>
323                                           <invokerPackage>${project.groupId}.${project.artifactId}.client.invoker</invokerPackage>
324                                         </configuration>
325                                   </execution>
326                                 </executions>
327                           </plugin>
328                           <plugin>
329                                 <artifactId>exec-maven-plugin</artifactId>
330                                 <groupId>org.codehaus.mojo</groupId>
331                                 <version>1.5.0</version>
332                                 <executions>
333                                   <execution>
334                                         <id>swagger-generate-sources</id>
335                                         <phase>generate-sources</phase>
336                                         <goals>
337                                           <goal>exec</goal>
338                                         </goals>
339                                         <configuration>
340                                           <executable>${project.build.directory}${file.separator}${swagger.sdk.script.file}</executable>
341                                         </configuration>
342                                   </execution>
343                                 </executions>
344                           </plugin>
345                           <plugin>
346                                 <groupId>org.apache.maven.plugins</groupId>
347                                 <artifactId>maven-clean-plugin</artifactId>
348                                 <version>3.0.0</version>
349                                 <executions>
350                                   <execution>
351                                         <id>clean-generated-files</id>
352                                         <phase>generate-sources</phase>
353                                         <goals>
354                                           <goal>clean</goal>
355                                         </goals>
356                                         <configuration>
357                                           <filesets>
358                                                 <fileset>
359                                                   <directory>${project.build.directory}/generated-sources</directory>
360                                                 </fileset>
361                                           </filesets>
362                                         </configuration>
363                                   </execution>
364                                 </executions>
365                           </plugin>
366                 </plugins>
367                 <resources>
368                         <resource>
369                                 <directory>src/main/java</directory>
370                                 <includes>
371                                         <include>**/*.properties</include>
372                                 </includes>
373                         </resource>
374                         <resource>
375                                 <directory>src/main/resources</directory>
376                         </resource>
377                 </resources>
378         </build>
379 </project>