Refactor sliapi springboot
[ccsdk/apps.git] / ms / sliboot / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4     <modelVersion>4.0.0</modelVersion>
5
6     <parent>
7         <groupId>org.onap.ccsdk.parent</groupId>
8         <artifactId>spring-boot-starter-parent</artifactId>
9         <version>2.0.0-SNAPSHOT</version>
10         <relativePath/>
11     </parent>
12
13     <groupId>org.onap.ccsdk.apps</groupId>
14     <artifactId>sliboot</artifactId>
15     <version>1.0.0-SNAPSHOT</version>
16     <packaging>jar</packaging>
17
18     <name>ccsdk-apps :: sliboot :: ${project.artifactId}</name>
19
20     <properties>
21         <start-class>org.onap.ccsdk.apps.ms.sliboot.App</start-class>
22         <shiro.version>1.5.0</shiro.version>
23         <aaf-shiro-bundle.version>2.1.13</aaf-shiro-bundle.version>
24         <base.image.name>onap/ccsdk-alpine-image</base.image.name>
25         <image.name>onap/ccsdk-sliboot-alpine-image</image.name>
26         <ccsdk.project.version>${project.version}</ccsdk.project.version>
27         <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
28         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
29         <ccsdk.sliboot.jar>${project.artifactId}-${project.version}.jar</ccsdk.sliboot.jar>
30         <docker.push.phase>deploy</docker.push.phase>
31         <docker.verbose>true</docker.verbose>
32     </properties>
33
34     <dependencies>
35         <dependency>
36             <groupId>io.swagger</groupId>
37             <artifactId>swagger-annotations</artifactId>
38         </dependency>
39         <dependency>
40             <groupId>org.apache.shiro</groupId>
41             <artifactId>shiro-spring-boot-web-starter</artifactId>
42             <version>${shiro.version}</version>
43             <exclusions>
44                 <exclusion>
45                     <groupId>org.springframework.boot</groupId>
46                     <artifactId>spring-boot-starter-logging</artifactId>
47                 </exclusion>
48             </exclusions>
49         </dependency>
50         <dependency>
51             <groupId>org.springframework.boot</groupId>
52             <artifactId>spring-boot-starter-log4j2</artifactId>
53         </dependency>
54         <dependency>
55             <groupId>org.onap.aaf.cadi</groupId>
56             <artifactId>aaf-cadi-shiro</artifactId>
57             <version>${aaf-shiro-bundle.version}</version>
58         </dependency>
59
60         <dependency>
61             <groupId>org.springframework.boot</groupId>
62             <artifactId>spring-boot-starter-test</artifactId>
63             <scope>test</scope>
64         </dependency>
65         <dependency>
66             <groupId>org.springframework.boot</groupId>
67             <artifactId>spring-boot-starter-data-jpa</artifactId>
68         </dependency>
69         <dependency>
70             <groupId>io.springfox</groupId>
71             <artifactId>springfox-swagger2</artifactId>
72             <version>2.9.2</version>
73         </dependency>
74         <dependency>
75             <groupId>io.springfox</groupId>
76             <artifactId>springfox-swagger-ui</artifactId>
77             <version>2.9.2</version>
78         </dependency>
79         <dependency>
80             <groupId>org.onap.ccsdk.sli.core</groupId>
81             <artifactId>dblib-provider</artifactId>
82             <version>${ccsdk.sli.core.version}</version>
83         </dependency>
84         <dependency>
85             <groupId>org.onap.ccsdk.sli.core</groupId>
86             <artifactId>sli-common</artifactId>
87             <version>${ccsdk.sli.core.version}</version>
88         </dependency>
89         <dependency>
90             <groupId>org.onap.ccsdk.sli.core</groupId>
91             <artifactId>sli-provider-base</artifactId>
92             <version>${ccsdk.sli.core.version}</version>
93         </dependency>
94         <dependency>
95             <groupId>com.google.code.gson</groupId>
96             <artifactId>gson</artifactId>
97         </dependency>
98         <dependency>
99             <groupId>org.apache.derby</groupId>
100             <artifactId>derby</artifactId>
101             <scope>test</scope>
102         </dependency>
103         <dependency>
104             <groupId>org.mariadb.jdbc</groupId>
105             <artifactId>mariadb-java-client</artifactId>
106         </dependency>
107         <dependency>
108             <groupId>junit</groupId>
109             <artifactId>junit</artifactId>
110             <scope>test</scope>
111         </dependency>
112         <dependency>
113             <groupId>org.onap.logging-analytics</groupId>
114             <artifactId>logging-filter-spring</artifactId>
115             <version>1.6.6</version>
116         </dependency>
117         <dependency>
118             <groupId>javax.ws.rs</groupId>
119             <artifactId>javax.ws.rs-api</artifactId>
120         </dependency>
121         <dependency>
122             <groupId>org.onap.ccsdk.sli.core</groupId>
123             <artifactId>sliPluginUtils-provider</artifactId>
124             <version>${ccsdk.sli.core.version}</version>
125         </dependency>
126         <dependency>
127             <groupId>org.onap.ccsdk.sli.plugins</groupId>
128             <artifactId>restapi-call-node-provider</artifactId>
129             <version>${ccsdk.sli.plugins.version}</version>
130         </dependency>
131         <dependency>
132             <groupId>org.onap.ccsdk.sli.plugins</groupId>
133             <artifactId>properties-node-provider</artifactId>
134             <version>${ccsdk.sli.plugins.version}</version>
135         </dependency>
136         <!-- this jersey jar is needed for rest api call node to function properly -->
137         <dependency>
138             <groupId>org.glassfish.jersey.inject</groupId>
139             <artifactId>jersey-hk2</artifactId>
140         </dependency>
141     </dependencies>
142
143     <build>
144         <plugins>
145             <plugin>
146                 <groupId>org.codehaus.groovy.maven</groupId>
147                 <artifactId>gmaven-plugin</artifactId>
148                 <executions>
149                     <execution>
150                         <phase>validate</phase>
151                         <goals>
152                             <goal>execute</goal>
153                         </goals>
154                         <configuration>
155                             <source>${basedir}/TagVersion.groovy</source>
156                         </configuration>
157                     </execution>
158                 </executions>
159             </plugin>
160
161             <plugin>
162                 <groupId>org.apache.maven.plugins</groupId>
163                 <artifactId>maven-dependency-plugin</artifactId>
164                 <version>2.10</version>
165
166                 <executions>
167                     <execution>
168                         <id>get-sliapi-yaml</id>
169                         <phase>initialize</phase>
170                         <goals>
171                             <goal>copy</goal>
172                         </goals>
173                         <configuration>
174                             <artifactItems>
175                                 <artifactItem>
176                                     <groupId>org.onap.ccsdk.sli.core</groupId>
177                                     <artifactId>sliapi-model-swagger</artifactId>
178                                     <version>${ccsdk.sli.core.version}</version>
179                                     <type>yaml</type>
180                                     <outputDirectory>${project.build.directory}/yaml</outputDirectory>
181                                     <destFileName>sliapi.yaml</destFileName>
182                                 </artifactItem>
183                             </artifactItems>
184                         </configuration>
185                     </execution>
186                 </executions>
187             </plugin>
188             <plugin>
189                 <groupId>io.swagger</groupId>
190                 <artifactId>swagger-codegen-maven-plugin</artifactId>
191                 <version>2.3.1</version>
192                 <executions>
193                     <execution>
194                         <goals>
195                             <goal>generate</goal>
196                         </goals>
197                         <configuration>
198                             <output>target/generated-sources</output>
199                             <inputSpec>${project.build.directory}/yaml/sliapi.yaml</inputSpec>
200                             <language>spring</language>
201                             <apiPackage>org.onap.ccsdk.apps.ms.sliboot.swagger</apiPackage>
202                             <modelPackage>org.onap.ccsdk.apps.ms.sliboot.swagger.model</modelPackage>
203                             <invokerPackage>org.onap.ccsdk.apps.ms.sliboot.swagger</invokerPackage>
204                             <generateApis>true</generateApis>
205                             <generateApiTests>true</generateApiTests>
206                             <ignoreFileOverride>${project.basedir}/.swagger-codegen-ignore</ignoreFileOverride>
207                             <withXml>true</withXml>
208                             <configOptions>
209                                 <java8>true</java8>
210                                 <springBootVersion>2.2.4-RELEASE</springBootVersion>
211                             </configOptions>
212                         </configuration>
213                     </execution>
214                 </executions>
215             </plugin>
216             <plugin>
217                 <groupId>org.springframework.boot</groupId>
218                 <artifactId>spring-boot-maven-plugin</artifactId>
219                 <executions>
220                     <execution>
221                         <goals>
222                             <goal>repackage</goal>
223                         </goals>
224                     </execution>
225                 </executions>
226             </plugin>
227
228         </plugins>
229     </build>
230
231     <profiles>
232         <profile>
233             <id>docker</id>
234             <build>
235                 <plugins>
236                     <plugin>
237                         <groupId>org.apache.maven.plugins</groupId>
238                         <artifactId>maven-dependency-plugin</artifactId>
239                         <version>2.10</version>
240
241                         <executions>
242                             <execution>
243                                 <id>copy-dependencies</id>
244                                 <goals>
245                                     <goal>copy-dependencies</goal>
246                                 </goals>
247                                 <phase>prepare-package</phase>
248                                 <configuration>
249                                     <excludeTransitive>true</excludeTransitive>
250                                     <outputDirectory>${project.build.directory}/docker-stage/opt/onap/ccsdk/lib</outputDirectory>
251                                     <overWriteReleases>false</overWriteReleases>
252                                     <overWriteSnapshots>true</overWriteSnapshots>
253                                     <overWriteIfNewer>true</overWriteIfNewer>
254                                     <useRepositoryLayout>false</useRepositoryLayout>
255                                     <addParentPoms>false</addParentPoms>
256                                     <copyPom>false</copyPom>
257                                 </configuration>
258                             </execution>
259                             <execution>
260                                 <id>unpack dgs</id>
261                                 <phase>generate-sources</phase>
262                                 <goals>
263                                     <goal>unpack</goal>
264                                 </goals>
265                                 <configuration>
266                                     <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
267                                     <artifactItems>
268                                         <artifactItem>
269                                             <groupId>org.onap.ccsdk.distribution</groupId>
270                                             <artifactId>platform-logic-installer</artifactId>
271                                             <version>${project.version}</version>
272                                             <type>zip</type>
273                                         </artifactItem>
274                                     </artifactItems>
275                                 </configuration>
276                             </execution>
277                         </executions>
278                     </plugin>
279                     <plugin>
280                         <artifactId>maven-resources-plugin</artifactId>
281                         <version>2.6</version>
282                         <executions>
283                             <execution>
284                                 <id>copy-dockerfile</id>
285                                 <goals>
286                                     <goal>copy-resources</goal>
287                                 </goals><!-- here the phase you need -->
288                                 <phase>initialize</phase>
289                                 <configuration>
290                                     <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
291                                     <resources>
292                                         <resource>
293                                             <directory>src/main/docker</directory>
294                                             <includes>
295                                                 <include>Dockerfile</include>
296                                             </includes>
297                                             <filtering>true</filtering>
298                                         </resource>
299                                     </resources>
300                                 </configuration>
301                             </execution>
302                             <execution>
303                                 <id>copy-config</id>
304                                 <goals>
305                                     <goal>copy-resources</goal>
306                                 </goals><!-- here the phase you need -->
307                                 <phase>generate-resources</phase>
308                                 <configuration>
309                                     <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/config</outputDirectory>
310                                     <resources>
311                                         <resource>
312                                             <directory>src/main/resources</directory>
313                                             <includes>
314                                                 <include>*.properties</include>
315                                                 <include>*.props</include>
316                                                 <include>*.sql</include>
317                                             </includes>
318                                             <filtering>true</filtering>
319                                         </resource>
320                                         <resource>
321                                             <directory>src/main/resources</directory>
322                                             <includes>
323                                                 <include>*.keyfile</include>
324                                                 <include>*.jks</include>
325                                                 <include>*.p12</include>
326                                             </includes>
327                                             <filtering>false</filtering>
328                                         </resource>
329                                     </resources>
330                                 </configuration>
331                             </execution>
332                             <execution>
333                                 <id>copy-script</id>
334                                 <goals>
335                                     <goal>copy-resources</goal>
336                                 </goals><!-- here the phase you need -->
337                                 <phase>generate-resources</phase>
338                                 <configuration>
339                                     <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/bin</outputDirectory>
340                                     <resources>
341                                         <resource>
342                                             <directory>src/main/resources</directory>
343                                             <includes>
344                                                 <include>*.sh</include>
345                                             </includes>
346                                             <filtering>true</filtering>
347                                         </resource>
348                                     </resources>
349                                 </configuration>
350                             </execution>
351                             <execution>
352                                 <id>copy-jar</id>
353                                 <goals>
354                                     <goal>copy-resources</goal>
355                                 </goals><!-- here the phase you need -->
356                                 <phase>package</phase>
357                                 <configuration>
358                                     <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/lib</outputDirectory>
359                                     <resources>
360                                         <resource>
361                                             <directory>${basedir}/target</directory>
362                                             <includes>
363                                                 <include>${ccsdk.sliboot.jar}</include>
364                                             </includes>
365                                             <filtering>false</filtering>
366                                         </resource>
367                                     </resources>
368                                 </configuration>
369                             </execution>
370                         </executions>
371                     </plugin>
372                     <plugin>
373                         <groupId>io.fabric8</groupId>
374                         <artifactId>docker-maven-plugin</artifactId>
375                         <version>0.28.0</version>
376                         <inherited>false</inherited>
377                         <configuration>
378                             <images>
379                                 <image>
380                                     <name>${image.name}</name>
381                                     <build>
382                                         <cleanup>try</cleanup>
383                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
384                                         <dockerFile>Dockerfile</dockerFile>
385                                         <tags>
386                                             <tag>${project.docker.latestminortag.version}</tag>
387                                             <tag>${project.docker.latestfulltag.version}</tag>
388                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
389                                         </tags>
390                                     </build>
391                                 </image>
392                             </images>
393                         </configuration>
394                         <executions>
395                             <execution>
396                                 <id>generate-images</id>
397                                 <phase>package</phase>
398                                 <goals>
399                                     <goal>build</goal>
400                                 </goals>
401                             </execution>
402
403                             <execution>
404                                 <id>push-images</id>
405                                 <phase>${docker.push.phase}</phase>
406                                 <goals>
407                                     <goal>build</goal>
408                                     <goal>push</goal>
409                                 </goals>
410                             </execution>
411                         </executions>
412                     </plugin>
413                 </plugins>
414             </build>
415         </profile>
416     </profiles>
417 </project>