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