Convert to aai-parent
[aai/model-loader.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     ============LICENSE_START=======================================================
4     org.onap.aai
5     ================================================================================
6     Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
7     Copyright © 2017-2018 European Software Marketing Ltd.
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 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24         <modelVersion>4.0.0</modelVersion>
25
26         <parent>
27                 <groupId>org.onap.aai.aai-common</groupId>
28                 <artifactId>aai-parent</artifactId>
29                 <version>1.6.6-SNAPSHOT</version>
30                 <relativePath />
31         </parent>
32
33         <groupId>org.onap.aai.model-loader</groupId>
34         <artifactId>model-loader</artifactId>
35         <name>aai-model-loader</name>
36         <version>1.6.0-SNAPSHOT</version>
37
38         <properties>
39                 <start-class>org.onap.aai.modelloader.service.ModelLoaderApplication</start-class>
40                 <nexusproxy>https://nexus.onap.org</nexusproxy>
41                 <docker.location>${basedir}/target</docker.location>
42                 <hamcrest-all.version>1.3</hamcrest-all.version>
43                 <babel.version>1.3.1</babel.version>
44                 <aai.rest.client.version>1.2.1</aai.rest.client.version>
45                 <sdc-distribution-client.version>1.3.0</sdc-distribution-client.version>
46                 <!-- docker related properties -->
47                 <docker.fabric.version>0.28.0</docker.fabric.version>
48                 <aai.docker.version>1.0.0</aai.docker.version>
49                 <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/</aai.build.directory>
50                 <aai.docker.namespace>onap</aai.docker.namespace>
51                 <aai.base.image>alpine</aai.base.image>
52                 <aai.base.image.version>1.6.0</aai.base.image.version>
53                 <!-- This will be used for the docker images as the default format of maven build has issues -->
54                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
55                 <!-- Code coverage enforcement -->
56                 <jacoco.report.directory>${project.build.directory}/code-coverage</jacoco.report.directory>
57                 <jacoco.line.coverage.limit>0.80</jacoco.line.coverage.limit>
58         </properties>
59
60         <distributionManagement>
61                 <repository>
62                         <id>ecomp-releases</id>
63                         <name>ECOMP Release Repository</name>
64                         <url>${nexusproxy}/content/repositories/releases/</url>
65                 </repository>
66                 <snapshotRepository>
67                         <id>ecomp-snapshots</id>
68                         <name>ECOMP Snapshot Repository</name>
69                         <url>${nexusproxy}/content/repositories/snapshots/</url>
70                 </snapshotRepository>
71         </distributionManagement>
72
73         <profiles>
74                 <!-- Docker profile to be used for building docker image and pushing to nexus -->
75                 <profile>
76                         <id>docker</id>
77                         <build>
78                                 <plugins>
79                                         <plugin>
80                                                 <groupId>org.codehaus.mojo</groupId>
81                                                 <artifactId>build-helper-maven-plugin</artifactId>
82                                                 <version>3.0.0</version>
83                                                 <executions>
84                                                         <execution>
85                                                                 <phase>pre-clean</phase>
86                                                                 <id>parse-version</id>
87                                                                 <goals>
88                                                                         <goal>parse-version</goal>
89                                                                 </goals>
90                                                         </execution>
91                                                 </executions>
92                                         </plugin>
93                                         <plugin>
94                                                 <groupId>org.codehaus.groovy.maven</groupId>
95                                                 <artifactId>gmaven-plugin</artifactId>
96                                                 <version>1.0</version>
97                                                 <executions>
98                                                         <execution>
99                                                                 <phase>pre-clean</phase>
100                                                                 <goals>
101                                                                         <goal>execute</goal>
102                                                                 </goals>
103                                                                 <configuration>
104                                                                         <source>
105                                                                                 def userAaiBaseImage = session.userProperties['aai.base.image'];
106                                                                                 def userAaiCommonVersion = session.userProperties['aai.base.image.version'];
107                                                                                 if (userAaiCommonVersion != null) {
108                                                                                         project.properties['aai.base.image.version'] = userAaiCommonVersion;
109                                                                                 }
110                                                                                 if (userAaiBaseImage != null) {
111                                                                                         project.properties['aai.base.image'] = userAaiBaseImage;
112                                                                                 }
113                                                                                 log.info 'Base image flavour: ' + project.properties['aai.base.image'];
114                                                                                 log.info 'Base image version: ' + project.properties['aai.base.image.version'];
115                                                                         </source>
116                                                                 </configuration>
117                                                         </execution>
118                                                 </executions>
119                                         </plugin>
120                                         <plugin>
121                                                 <groupId>io.fabric8</groupId>
122                                                 <artifactId>docker-maven-plugin</artifactId>
123                                                 <version>${docker.fabric.version}</version>
124                                                 <configuration>
125                                                         <verbose>true</verbose>
126                                                         <apiVersion>1.23</apiVersion>
127                                                         <images>
128                                                                 <image>
129                                                                         <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l</name>
130                                                                         <build>
131                                                                                 <filter>@</filter>
132                                                                                 <tags>
133                                                                                         <tag>latest</tag>
134                                                                                         <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
135                                                                                         <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag>
136                                                                                 </tags>
137                                                                                 <cleanup>try</cleanup>
138                                                                                 <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
139                                                                                 <assembly>
140                                                                                         <inline>
141                                                                                                 <fileSets>
142                                                                                                         <fileSet>
143                                                                                                                 <directory>${aai.build.directory}</directory>
144                                                                                                                 <outputDirectory>/${project.artifactId}</outputDirectory>
145                                                                                                         </fileSet>
146                                                                                                 </fileSets>
147                                                                                         </inline>
148                                                                                 </assembly>
149                                                                         </build>
150                                                                 </image>
151                                                         </images>
152                                                 </configuration>
153                                                 <executions>
154                                                         <execution>
155                                                                 <id>clean-images</id>
156                                                                 <phase>pre-clean</phase>
157                                                                 <goals>
158                                                                         <goal>remove</goal>
159                                                                 </goals>
160                                                                 <configuration>
161                                                                         <removeAll>true</removeAll>
162                                                                 </configuration>
163                                                         </execution>
164                                                         <execution>
165                                                                 <id>generate-images</id>
166                                                                 <phase>package</phase>
167                                                                 <goals>
168                                                                         <goal>build</goal>
169                                                                 </goals>
170                                                         </execution>
171                                                         <execution>
172                                                                 <id>push-images</id>
173                                                                 <phase>deploy</phase>
174                                                                 <goals>
175                                                                         <goal>push</goal>
176                                                                 </goals>
177                                                         </execution>
178                                                 </executions>
179                                         </plugin>
180                                 </plugins>
181                         </build>
182                 </profile>
183         </profiles>
184
185         <dependencies>
186                 <dependency>
187                         <groupId>org.springframework.boot</groupId>
188                         <artifactId>spring-boot-starter-jetty</artifactId>
189                 </dependency>
190                 <dependency>
191                         <groupId>org.springframework.boot</groupId>
192                         <artifactId>spring-boot-starter-web</artifactId>
193                         <exclusions>
194                           <exclusion>
195                             <groupId>org.springframework.boot</groupId>
196                             <artifactId>spring-boot-starter-tomcat</artifactId>
197                           </exclusion>
198                         </exclusions>
199                 </dependency>
200                 <dependency>
201                         <groupId>org.onap.aai</groupId>
202                         <artifactId>babel</artifactId>
203                         <version>${babel.version}</version>
204                         <classifier>client</classifier>
205                         <exclusions>
206                                 <exclusion>
207                                         <groupId>*</groupId>
208                                         <artifactId>*</artifactId>
209                                 </exclusion>
210                         </exclusions>
211                 </dependency>
212                 <dependency>
213                         <groupId>org.glassfish.jersey.core</groupId>
214                         <artifactId>jersey-common</artifactId>
215                         <scope>test</scope>
216                 </dependency>
217                 <dependency>
218                         <groupId>org.onap.aai</groupId>
219                         <artifactId>rest-client</artifactId>
220                 </dependency>
221                 <dependency>
222                         <groupId>com.google.code.gson</groupId>
223                         <artifactId>gson</artifactId>
224                 </dependency>
225
226                 <!-- Test dependencies -->
227                 <!-- https://mvnrepository.com/artifact/com.mikesamuel/json-sanitizer -->
228                 <dependency>
229                         <groupId>com.mikesamuel</groupId>
230                         <artifactId>json-sanitizer</artifactId>
231                         <version>1.2.0</version>
232                 </dependency>
233
234                 <!-- Common logging framework -->
235                 <dependency>
236                         <groupId>org.onap.aai.logging-service</groupId>
237                         <artifactId>common-logging</artifactId>
238                 </dependency>
239                 <dependency>
240                         <groupId>ch.qos.logback</groupId>
241                         <artifactId>logback-classic</artifactId>
242                 </dependency>
243                 <dependency>
244                         <groupId>ch.qos.logback</groupId>
245                         <artifactId>logback-core</artifactId>
246                 </dependency>
247                 <dependency>
248                         <groupId>org.onap.sdc.sdc-distribution-client</groupId>
249                         <artifactId>sdc-distribution-client</artifactId>
250                         <version>${sdc-distribution-client.version}</version>
251                 </dependency>
252                 <dependency>
253                         <groupId>org.json</groupId>
254                         <artifactId>json</artifactId>
255                 </dependency>
256                 <dependency>
257                         <groupId>org.eclipse.jetty</groupId>
258                         <artifactId>jetty-security</artifactId>
259                 </dependency>
260                 <dependency>
261                         <groupId>jline</groupId>
262                         <artifactId>jline</artifactId>
263                         <version>2.12.1</version>
264                 </dependency>
265                 <dependency>
266                         <groupId>org.apache.commons</groupId>
267                         <artifactId>commons-compress</artifactId>
268                 </dependency>
269                 <dependency>
270                         <groupId>commons-io</groupId>
271                         <artifactId>commons-io</artifactId>
272                 </dependency>
273                 <dependency>
274                         <groupId>org.apache.commons</groupId>
275                         <artifactId>commons-text</artifactId>
276                 </dependency>
277
278                 <!-- Test dependencies -->
279                 <dependency>
280                         <groupId>junit</groupId>
281                         <artifactId>junit</artifactId>
282                         <scope>test</scope>
283                 </dependency>
284                 <dependency>
285                         <groupId>org.hamcrest</groupId>
286                         <artifactId>hamcrest-all</artifactId>
287                         <version>${hamcrest-all.version}</version>
288                         <scope>test</scope>
289                 </dependency>
290                 <dependency>
291                         <groupId>org.mockito</groupId>
292                         <artifactId>mockito-core</artifactId>
293                         <scope>test</scope>
294                 </dependency>
295                 <dependency>
296                         <groupId>org.springframework.boot</groupId>
297                         <artifactId>spring-boot-starter-test</artifactId>
298                         <scope>test</scope>
299                 </dependency>
300         </dependencies>
301
302         <!-- Plugins and repositories -->
303         <pluginRepositories>
304                 <pluginRepository>
305                         <id>central</id>
306                         <url>http://repo1.maven.org/maven2</url>
307                 </pluginRepository>
308                 <pluginRepository>
309                         <id>EvoSuite</id>
310                         <name>EvoSuite Repository</name>
311                         <url>http://www.evosuite.org/m2</url>
312                 </pluginRepository>
313         </pluginRepositories>
314
315         <repositories>
316                 <repository>
317                         <id>central</id>
318                         <name>Maven 2 repository 2</name>
319                         <url>http://repo2.maven.org/maven2/</url>
320                 </repository>
321                 <repository>
322                         <id>ecomp-releases</id>
323                         <name>ECOMP Release Repository</name>
324                         <url>${nexusproxy}/content/repositories/releases/</url>
325                 </repository>
326                 <repository>
327                         <id>ecomp-snapshots</id>
328                         <name>ECOMP Snapshot Repository</name>
329                         <url>${nexusproxy}/content/repositories/snapshots/</url>
330                 </repository>
331                 <repository>
332                         <id>ecomp-staging</id>
333                         <name>ECOMP Staging Repository</name>
334                         <url>${nexusproxy}/content/repositories/staging/</url>
335                 </repository>
336         </repositories>
337
338         <build>
339                 <plugins>
340                         <plugin>
341                                 <groupId>org.springframework.boot</groupId>
342                                 <artifactId>spring-boot-maven-plugin</artifactId>
343                                 <configuration>
344                                         <executable>true</executable>
345                                 </configuration>
346                                 <executions>
347                                         <execution>
348                                                 <goals>
349                                                         <goal>repackage</goal>
350                                                 </goals>
351                                         </execution>
352                                 </executions>
353                         </plugin>
354                         <plugin>
355                                 <groupId>com.mycila</groupId>
356                                 <artifactId>license-maven-plugin</artifactId>
357                                 <version>3.0</version>
358                                 <configuration>
359                                         <header>License.txt</header>
360                                         <includes>
361                                                 <include>src/main/java/**</include>
362                                                 <include>src/test/java/**</include>
363                                                 <include>version/properties</include>
364                                                 <include>pom.xml</include>
365                                         </includes>
366                                         <skipExistingHeaders>true</skipExistingHeaders>
367                                 </configuration>
368                                 <executions>
369                                         <execution>
370                                                 <goals>
371                                                         <!-- Set goal to "format" to auto update license headers -->
372                                                         <goal>check</goal>
373                                                 </goals>
374                                                 <phase>process-sources</phase>
375                                         </execution>
376                                 </executions>
377                         </plugin>
378                         <plugin>
379                                 <groupId>org.apache.maven.plugins</groupId>
380                                 <artifactId>maven-deploy-plugin</artifactId>
381                         </plugin>
382                         <plugin>
383                                 <artifactId>maven-assembly-plugin</artifactId>
384                                 <configuration>
385                                         <descriptors>
386                                                 <descriptor>src/main/assembly/descriptor.xml</descriptor>
387                                         </descriptors>
388                                 </configuration>
389                                 <executions>
390                                         <execution>
391                                                 <id>make-assembly</id>
392                                                 <phase>package</phase>
393                                                 <goals>
394                                                         <goal>single</goal>
395                                                 </goals>
396                                         </execution>
397                                 </executions>
398                         </plugin>
399                         <plugin>
400                                 <groupId>org.jacoco</groupId>
401                                 <artifactId>jacoco-maven-plugin</artifactId>
402                                 <executions>
403                                         <execution>
404                                                 <id>default-check</id>
405                                                 <goals>
406                                                         <goal>check</goal>
407                                                 </goals>
408                                                 <configuration>
409                                                         <dataFile>${jacoco.report.directory}/jacoco-ut.exec</dataFile>
410                                                         <rules>
411                                 <!--  implementation is needed only for Maven 2  -->
412                                                                 <rule implementation="org.jacoco.maven.RuleConfiguration">
413                                                                         <element>BUNDLE</element>
414                                                                         <limits>
415                                                                                 <limit implementation="org.jacoco.report.check.Limit">
416                                                                                         <counter>LINE</counter>
417                                                                                         <value>COVEREDRATIO</value>
418                                                                                         <minimum>${jacoco.line.coverage.limit}</minimum>
419                                                                                 </limit>
420                                                                         </limits>
421                                                                 </rule>
422                                                         </rules>
423                                                 </configuration>
424                                         </execution>
425                                 </executions>
426                         </plugin>
427                 </plugins>
428         </build>
429 </project>