Fixed project version parsing
[aai/search-data-service.git] / search-data-service-app / pom.xml
1 <!--
2
3     ============LICENSE_START=======================================================
4     org.onap.aai
5     ================================================================================
6     Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
7     Copyright © 2017-2018 Amdocs
8     ================================================================================
9     Licensed under the Apache License, Version 2.0 (the "License");
10     you may not use this file except in compliance with the License.
11     You may obtain a copy of the License at
12
13           http://www.apache.org/licenses/LICENSE-2.0
14
15     Unless required by applicable law or agreed to in writing, software
16     distributed under the License is distributed on an "AS IS" BASIS,
17     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18     See the License for the specific language governing permissions and
19     limitations under the License.
20     ============LICENSE_END=========================================================
21
22 -->
23 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
25     <modelVersion>4.0.0</modelVersion>
26
27     <parent>
28         <artifactId>search-data-service</artifactId>
29         <groupId>org.onap.aai</groupId>
30         <version>1.6.0-SNAPSHOT</version>
31     </parent>
32
33     <groupId>org.onap.aai.search-data-service</groupId>
34     <artifactId>search-data-service-app</artifactId>
35     <version>1.6.0-SNAPSHOT</version>
36     <name>AAI Search Data Service Application</name>
37
38     <properties>
39         <docker.image.name.suffix>search-data-service</docker.image.name.suffix>
40         <java.version>1.8</java.version>
41         <generatedSourceDir>${basedir}/src/main/java-gen</generatedSourceDir>
42         <checkstyle.config.location>google_checks.xml</checkstyle.config.location>
43
44         <sonar.language>java</sonar.language>
45         <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
46         <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports
47         </sonar.surefire.reportsPath>
48         <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec
49         </sonar.jacoco.reportPath>
50         <sonar.jacoco.reportMissing.force.zero>false</sonar.jacoco.reportMissing.force.zero>
51         <sonar.projectVersion>${project.version}</sonar.projectVersion>
52         <jacoco.line.coverage.limit>0.58</jacoco.line.coverage.limit>
53         <spring.boot.version>1.5.21.RELEASE</spring.boot.version>
54     </properties>
55
56     <dependencyManagement>
57         <dependencies>
58             <dependency>
59                 <groupId>org.springframework.boot</groupId>
60                 <artifactId>spring-boot-starter-parent</artifactId>
61                 <version>${spring.boot.version}</version>
62                 <type>pom</type>
63                 <scope>import</scope>
64             </dependency>
65         </dependencies>
66     </dependencyManagement>
67
68     <dependencies>
69
70         <dependency>
71             <groupId>com.google.code.gson</groupId>
72             <artifactId>gson</artifactId>
73         </dependency>
74
75         <dependency>
76             <groupId>org.hamcrest</groupId>
77             <artifactId>hamcrest-library</artifactId>
78             <scope>test</scope>
79         </dependency>
80
81         <dependency>
82             <groupId>com.jayway.jsonpath</groupId>
83             <artifactId>json-path</artifactId>
84         </dependency>
85
86         <dependency>
87             <groupId>com.googlecode.json-simple</groupId>
88             <artifactId>json-simple</artifactId>
89         </dependency>
90
91         <dependency>
92             <groupId>org.dom4j</groupId>
93             <artifactId>dom4j</artifactId>
94             <version>2.1.1</version>
95             <scope>provided</scope>
96         </dependency>
97
98         <dependency>
99             <groupId>commons-io</groupId>
100             <artifactId>commons-io</artifactId>
101             <version>2.4</version>
102         </dependency>
103
104         <dependency>
105             <groupId>org.mockito</groupId>
106             <artifactId>mockito-all</artifactId>
107             <version>1.10.19</version>
108             <scope>test</scope>
109         </dependency>
110
111         <!-- Common logging framework -->
112         <dependency>
113             <groupId>org.onap.aai.logging-service</groupId>
114             <artifactId>common-logging</artifactId>
115             <version>1.5.0</version>
116         </dependency>
117
118         <dependency>
119             <groupId>org.onap.aai.logging-service</groupId>
120             <artifactId>logging-api</artifactId>
121             <version>1.5.0</version>
122         </dependency>
123
124         <dependency>
125             <groupId>org.onap.aai.logging-service</groupId>
126             <artifactId>eelf-logging</artifactId>
127             <version>1.5.0</version>
128         </dependency>
129
130         <!-- For JSON Mapping Support. -->
131         <dependency>
132             <groupId>com.fasterxml.jackson.core</groupId>
133             <artifactId>jackson-databind</artifactId>
134         </dependency>
135
136         <dependency>
137             <groupId>org.apache.directory.studio</groupId>
138             <artifactId>org.apache.commons.lang</artifactId>
139             <version>2.6</version>
140         </dependency>
141
142         <dependency>
143             <groupId>radeox</groupId>
144             <artifactId>radeox</artifactId>
145             <version>0.9</version>
146         </dependency>
147
148         <dependency>
149             <groupId>com.github.fge</groupId>
150             <artifactId>json-schema-validator</artifactId>
151             <version>2.0.0</version>
152         </dependency>
153
154         <dependency>
155             <groupId>org.json</groupId>
156             <artifactId>json</artifactId>
157             <version>20180130</version>
158         </dependency>
159
160         <dependency>
161             <groupId>org.springframework.boot</groupId>
162             <artifactId>spring-boot-starter-web</artifactId>
163             <exclusions>
164                 <exclusion>
165                     <groupId>org.springframework.boot</groupId>
166                     <artifactId>spring-boot-starter-tomcat</artifactId>
167                 </exclusion>
168             </exclusions>
169         </dependency>
170
171         <dependency>
172             <groupId>org.springframework.boot</groupId>
173             <artifactId>spring-boot-starter-jetty</artifactId>
174         </dependency>
175
176         <dependency>
177             <groupId>org.springframework.boot</groupId>
178             <artifactId>spring-boot-starter</artifactId>
179             <exclusions>
180                 <exclusion>
181                     <groupId>ch.qos.logback</groupId>
182                     <artifactId>logback-classic</artifactId>
183                 </exclusion>
184             </exclusions>
185         </dependency>
186
187         <dependency>
188             <groupId>org.springframework.boot</groupId>
189             <artifactId>spring-boot-starter-jersey</artifactId>
190             <exclusions>
191                 <exclusion>
192                     <groupId>org.springframework.boot</groupId>
193                     <artifactId>spring-boot-starter-tomcat</artifactId>
194                 </exclusion>
195             </exclusions>
196         </dependency>
197
198         <dependency>
199             <groupId>org.springframework.boot</groupId>
200             <artifactId>spring-boot-starter-actuator</artifactId>
201         </dependency>
202
203         <dependency>
204             <groupId>org.springframework.boot</groupId>
205             <artifactId>spring-boot-starter-test</artifactId>
206             <scope>test</scope>
207         </dependency>
208
209         <dependency>
210             <groupId>org.springframework.boot</groupId>
211             <artifactId>spring-boot-starter-security</artifactId>
212         </dependency>
213
214         <!--Logback classic-->
215         <dependency>
216             <groupId>ch.qos.logback</groupId>
217             <artifactId>logback-classic</artifactId>
218         </dependency>
219
220         <dependency>
221             <groupId>ch.qos.logback</groupId>
222             <artifactId>logback-core</artifactId>
223         </dependency>
224
225     </dependencies>
226
227     <repositories>
228         <repository>
229             <id>central</id>
230             <name>Maven 2 repository 2</name>
231             <url>http://repo2.maven.org/maven2/</url>
232         </repository>
233         <repository>
234             <id>ecomp-releases</id>
235             <name>ECOMP Release Repository</name>
236             <url>${nexusproxy}/content/repositories/releases/</url>
237         </repository>
238         <repository>
239             <id>ecomp-snapshots</id>
240             <name>ECOMP Snapshot Repository</name>
241             <url>${nexusproxy}/content/repositories/snapshots/</url>
242         </repository>
243         <repository>
244             <id>ecomp-staging</id>
245             <name>ECOMP Staging Repository</name>
246             <url>${nexusproxy}/content/repositories/staging/</url>
247         </repository>
248     </repositories>
249     
250     <profiles>
251         <profile>
252             <id>docker</id>
253             <build>
254                 <plugins>
255                     <plugin>
256                         <groupId>org.codehaus.mojo</groupId>
257                         <artifactId>build-helper-maven-plugin</artifactId>
258                         <version>3.0.0</version>
259                     </plugin>
260                     <plugin>
261                         <artifactId>maven-assembly-plugin</artifactId>
262                         <configuration>
263                             <descriptors>
264                                 <descriptor>src/main/assembly/descriptor.xml</descriptor>
265                             </descriptors>
266                         </configuration>
267                         <executions>
268                             <execution>
269                                 <id>make-assembly</id>
270                                 <phase>package</phase>
271                                 <goals>
272                                     <goal>single</goal>
273                                 </goals>
274                             </execution>
275                         </executions>
276                     </plugin>
277                     <plugin>
278                         <groupId>org.codehaus.groovy.maven</groupId>
279                         <artifactId>gmaven-plugin</artifactId>
280                         <version>1.0</version>
281                         <executions>
282                             <execution>
283                                 <phase>prepare-package</phase>
284                                 <goals>
285                                     <goal>execute</goal>
286                                 </goals>
287                                 <configuration>
288                                     <source>
289                                         def userAaiBaseImage = session.userProperties['aai.base.image']
290                                         def userAaiCommonVersion = session.userProperties['aai.base.image.version']
291                                         if (userAaiCommonVersion != null) {
292                                             project.properties['aai.base.image.version'] = userAaiCommonVersion
293                                         }
294                                         if (userAaiBaseImage != null) {
295                                             project.properties['aai.base.image'] = userAaiBaseImage
296                                         }
297                                         log.info 'Base image flavour: ' + project.properties['aai.base.image']
298                                         log.info 'Base image version: ' + project.properties['aai.base.image.version']
299                                     </source>
300                                 </configuration>
301                             </execution>
302                         </executions>
303                     </plugin>
304                     <plugin>
305                         <groupId>io.fabric8</groupId>
306                         <artifactId>docker-maven-plugin</artifactId>
307                         <version>${docker.fabric.version}</version>
308                         <configuration>
309                             <verbose>true</verbose>
310                             <apiVersion>1.23</apiVersion>
311                             <images>
312                                 <image>
313                                     <name>${docker.push.registry}/${aai.docker.namespace}/${docker.image.name.suffix}:%l
314                                     </name>
315                                     <build>
316                                         <filter>@</filter>
317                                         <tags>
318                                             <tag>latest</tag>
319                                             <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
320                                             <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
321                                         </tags>
322                                         <cleanup>try</cleanup>
323                                         <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
324                                         <assembly>
325                                             <inline>
326                                                 <fileSets>
327                                                     <fileSet>
328                                                         <directory>${aai.build.directory}</directory>
329                                                         <outputDirectory>/${project.artifactId}</outputDirectory>
330                                                     </fileSet>
331                                                 </fileSets>
332                                             </inline>
333                                         </assembly>
334                                     </build>
335                                 </image>
336                             </images>
337                         </configuration>
338                         <executions>
339                             <execution>
340                                 <id>clean-images</id>
341                                 <phase>clean</phase>
342                                 <goals>
343                                     <goal>remove</goal>
344                                 </goals>
345                                 <configuration>
346                                     <removeAll>true</removeAll>
347                                 </configuration>
348                             </execution>
349                             <execution>
350                                 <id>generate-images</id>
351                                 <phase>package</phase>
352                                 <goals>
353                                     <goal>build</goal>
354                                 </goals>
355                             </execution>
356                             <execution>
357                                 <id>push-images</id>
358                                 <phase>deploy</phase>
359                                 <goals>
360                                     <goal>push</goal>
361                                 </goals>
362                             </execution>
363                         </executions>
364                     </plugin>
365                 </plugins>
366             </build>
367         </profile>
368     </profiles>
369     <build>
370         <finalName>${project.artifactId}</finalName>
371         <plugins>
372             <plugin>
373                 <groupId>org.springframework.boot</groupId>
374                 <artifactId>spring-boot-maven-plugin</artifactId>
375                 <executions>
376                     <execution>
377                         <goals>
378                             <goal>repackage</goal>
379                         </goals>
380                     </execution>
381                 </executions>
382             </plugin>
383             <!-- Checkstyle plugin - used to report on compliance with -->
384             <!-- the Google style guide. -->
385             <plugin>
386                 <groupId>org.apache.maven.plugins</groupId>
387                 <artifactId>maven-site-plugin</artifactId>
388                 <configuration>
389                     <reportPlugins>
390                         <plugin>
391                             <groupId>org.apache.maven.plugins</groupId>
392                             <artifactId>maven-checkstyle-plugin</artifactId>
393                             <version>2.17</version>
394                             <reportSets>
395                                 <reportSet>
396                                     <reports>
397                                         <report>checkstyle</report>
398                                     </reports>
399                                 </reportSet>
400                             </reportSets>
401                         </plugin>
402                     </reportPlugins>
403                 </configuration>
404             </plugin>
405             <!-- This plugin overrides the compiler settings to use java 1.8 -->
406             <plugin>
407                 <groupId>org.apache.maven.plugins</groupId>
408                 <artifactId>maven-compiler-plugin</artifactId>
409                 <configuration>
410                     <compilerId>groovy-eclipse-compiler</compilerId>
411                     <verbose>true</verbose>
412                     <source>1.8</source>
413                     <target>1.8</target>
414                 </configuration>
415                 <dependencies>
416                     <dependency>
417                         <groupId>org.codehaus.groovy</groupId>
418                         <artifactId>groovy-eclipse-compiler</artifactId>
419                         <version>2.9.0-01</version>
420                     </dependency>
421                     <dependency>
422                         <groupId>org.codehaus.groovy</groupId>
423                         <artifactId>groovy-eclipse-batch</artifactId>
424                         <version>2.3.4-01</version>
425                     </dependency>
426                 </dependencies>
427             </plugin>
428             <!-- This plugin is used to generate Java POJO's from json format schema
429                 file. -->
430             <plugin>
431                 <groupId>org.jsonschema2pojo</groupId>
432                 <artifactId>jsonschema2pojo-maven-plugin</artifactId>
433                 <version>0.4.26</version>
434                 <configuration>
435                     <addCompileSourceRoot>true</addCompileSourceRoot>
436                     <sourceDirectory>${basedir}/src/main/resources/json/schema</sourceDirectory>
437                     <outputDirectory>${generatedSourceDir}</outputDirectory>
438                     <targetPackage>org.onap.aai.sa.rest</targetPackage>
439                 </configuration>
440                 <executions>
441                     <execution>
442                         <goals>
443                             <goal>generate</goal>
444                         </goals>
445                     </execution>
446                 </executions>
447             </plugin>
448
449             <!-- license plugin -->
450             <plugin>
451                 <groupId>com.mycila</groupId>
452                 <artifactId>license-maven-plugin</artifactId>
453                 <version>3.0</version>
454                 <configuration>
455                     <header>License.txt</header>
456                     <includes>
457                         <include>src/main/java/**</include>
458                         <include>src/test/java/**</include>
459                         <include>pom.xml</include>
460                     </includes>
461                     <skipExistingHeaders>true</skipExistingHeaders>
462                 </configuration>
463                 <executions>
464                     <execution>
465                         <goals>
466                             <goal>check</goal>
467                         </goals>
468                         <phase>validate</phase>
469                     </execution>
470                 </executions>
471             </plugin>
472             <plugin>
473                 <groupId>org.apache.maven.plugins</groupId>
474                 <artifactId>maven-deploy-plugin</artifactId>
475             </plugin>
476             <plugin>
477                 <groupId>org.codehaus.mojo</groupId>
478                 <artifactId>sonar-maven-plugin</artifactId>
479                 <version>3.2</version>
480             </plugin>
481             <!-- jacoco-maven-plugin provides the basic report creation during unit testing, such as code-coverage, sonar, etc. -->
482             <plugin>
483                 <groupId>org.jacoco</groupId>
484                 <artifactId>jacoco-maven-plugin</artifactId>
485                 <executions>
486                     <!-- Prepares the property pointing to the JaCoCo runtime agent which
487                          is passed as VM argument when Maven the Surefire plugin is executed. -->
488                     <execution>
489                         <id>pre-unit-test</id>
490                         <goals>
491                             <goal>prepare-agent</goal>
492                         </goals>
493                         <configuration>
494                             <!-- Sets the path to the file which contains the execution data. -->
495                             <destFile>${sonar.jacoco.reportPath}</destFile>
496                             <propertyName>surefireArgLine</propertyName>
497                         </configuration>
498                     </execution>
499                     <!-- Ensures that the code coverage report for unit tests is created
500                          after unit tests have been run. -->
501                     <execution>
502                         <id>post-unit-test</id>
503                         <phase>test</phase>
504                         <goals>
505                             <goal>report</goal>
506                         </goals>
507                         <configuration>
508                             <!-- Sets the path to the file which contains the execution data. -->
509                             <dataFile>${sonar.jacoco.reportPath}</dataFile>
510                             <!-- Sets the output directory for the code coverage report. -->
511                             <outputDirectory>${jacoco.path}</outputDirectory>
512                         </configuration>
513                     </execution>
514                     <!-- Prepares the property pointing to the JaCoCo runtime agent which
515                          is passed as VM argument when Maven the Failsafe plugin is executed. -->
516                     <execution>
517                         <id>pre-integration-test</id>
518                         <phase>pre-integration-test</phase>
519                         <goals>
520                             <goal>prepare-agent</goal>
521                         </goals>
522                         <configuration>
523                             <!-- Sets the path to the file which contains the execution data. -->
524                             <destFile>${sonar.jacoco.itReportPath}</destFile>
525                             <!-- Sets the name of the property containing the settings for JaCoCo
526                                  runtime agent. -->
527                             <propertyName>failsafeArgLine</propertyName>
528                         </configuration>
529                     </execution>
530                     <!-- Ensures that the code coverage report for integration tests after
531                          integration tests have been run. -->
532                     <execution>
533                         <id>post-integration-test</id>
534                         <phase>post-integration-test</phase>
535                         <goals>
536                             <goal>report</goal>
537                         </goals>
538                         <configuration>
539                             <!-- Sets the path to the file which contains the execution data. -->
540                             <dataFile>${sonar.jacoco.itReportPath}/</dataFile>
541                             <!-- Sets the output directory for the code coverage report. -->
542                             <outputDirectory>${jacoco.itPath}</outputDirectory>
543                         </configuration>
544                     </execution>
545                     <execution>
546                         <id>default-check</id>
547                         <goals>
548                             <goal>check</goal>
549                         </goals>
550                         <configuration>
551                             <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
552                             <rules>
553                                 <!--  implementation is needed only for Maven 2  -->
554                                 <rule implementation="org.jacoco.maven.RuleConfiguration">
555                                     <element>BUNDLE</element>
556                                     <limits>
557                                         <limit implementation="org.jacoco.report.check.Limit">
558                                             <counter>LINE</counter>
559                                             <value>COVEREDRATIO</value>
560                                             <minimum>${jacoco.line.coverage.limit}</minimum>
561                                         </limit>
562                                     </limits>
563                                 </rule>
564                             </rules>
565                         </configuration>
566                     </execution>
567                 </executions>
568             </plugin>
569             <!-- This plugin adds the generated sources directory to the clean lifecycle
570                 so that automatically generated code will get cleaned up properly. -->
571             <plugin>
572                 <artifactId>maven-clean-plugin</artifactId>
573                 <configuration>
574                     <filesets>
575                         <fileset>
576                             <directory>${generatedSourceDir}</directory>
577                         </fileset>
578                     </filesets>
579                 </configuration>
580             </plugin>
581         </plugins>
582     </build>
583     <distributionManagement>
584         <repository>
585             <id>ecomp-releases</id>
586             <name>ECOMP Release Repository</name>
587             <url>${nexusproxy}/content/repositories/releases/</url>
588         </repository>
589         <snapshotRepository>
590             <id>ecomp-snapshots</id>
591             <name>ECOMP Snapshot Repository</name>
592             <url>${nexusproxy}/content/repositories/snapshots/</url>
593         </snapshotRepository>
594         <site>
595             <id>ecomp-javadoc</id>
596             <url>dav:https://ecomp-nexus:8443/repository/aai/search-data-service-javadoc/${project.version}</url>
597         </site>
598     </distributionManagement>
599 </project>