naming ms - pom updates for docker.
[ccsdk/apps.git] / ms / neng / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- 
3  * ============LICENSE_START=======================================================
4  * ONAP : CCSDK.apps
5  * ================================================================================
6  * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20   -->
21 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23     <modelVersion>4.0.0</modelVersion>
24
25     <groupId>org.onap.ccsdk.apps</groupId>
26     <artifactId>ccsdk-apps-ms-neng</artifactId>
27     <version>0.3.0-SNAPSHOT</version>
28
29     <properties>
30         <swagger.directory>${basedir}/target/classes/META-INF/resources/swagger</swagger.directory>
31         <icd.file>service.json</icd.file>
32         <icd.package>org.onap.ccsdk.apps.ms.neng.service.rs</icd.package>
33         <java.version>1.8</java.version>
34         <spring.version>4.3.8.RELEASE</spring.version>
35         <springboot.version>1.5.6.RELEASE</springboot.version>
36         <docker.registry>nexus3.onap.org:10001</docker.registry>
37         <build.number>local</build.number>
38         <kube.namespace>TBD</kube.namespace>
39         <service.account>TBD</service.account>
40         <namespace>org.onap.ccsdk.apps.ms.neng</namespace>
41         <maven.compiler.source>1.8</maven.compiler.source>
42         <maven.compiler.target>1.8</maven.compiler.target>
43         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
44         <sdk.java.rest>6.2.0.11</sdk.java.rest>
45         <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
46         <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
47         <sonar.surefire.reportsPath>${basedir}/target/surefire-reports</sonar.surefire.reportsPath>
48         <sonar.failsafe.reportsPath>${basedir}/target/failsafe-reports</sonar.failsafe.reportsPath>
49         <jacoco.path>${basedir}/target/jacoco_report</jacoco.path>
50         <jacoco.itPath>${basedir}/target/jacoco_itReport</jacoco.itPath>
51         <sonar.jacoco.reportPath>${basedir}/target/jacoco-ut.exec</sonar.jacoco.reportPath>
52         <sonar.jacoco.itReportPath>${basedir}/target/jacoco-it.exec</sonar.jacoco.itReportPath>
53         <sonar.language>java</sonar.language>
54         <serviceArtifactName>ms-networkelementnamegen</serviceArtifactName>
55         <project.version>0.3.0</project.version>
56         <ccsdk.distribution.version>0.2.4</ccsdk.distribution.version>
57         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
58                 <docker.push.phase>deploy</docker.push.phase>
59                 <docker.build.phase>deploy</docker.build.phase>
60                 <docker.verbose>true</docker.verbose>
61                 <ccsdk.project.version>${project.version}</ccsdk.project.version>
62     </properties>
63
64     <profiles>
65         <profile>
66             <id>all-tests</id>
67             <properties>
68                 <build.profile.id>all-tests</build.profile.id>
69                 <skip.integration.tests>false</skip.integration.tests>
70                 <skip.unit.tests>false</skip.unit.tests>
71             </properties>
72         </profile>
73         <profile>
74             <id>dev</id>
75         </profile>
76         <profile>
77             <id>integration-test</id>
78             <properties>
79                 <build.profile.id>integration-test</build.profile.id>
80                 <skip.integration.tests>false</skip.integration.tests>
81                 <skip.unit.tests>true</skip.unit.tests>
82             </properties>
83         </profile>
84
85         <profile>
86             <id>blackduck</id>
87             <activation>
88                 <property>
89                     <name>blackduck-scan</name>
90                 </property>
91             </activation>
92             <build>
93                 <plugins>
94                     <plugin>
95                         <groupId>com.blackducksoftware.integration</groupId>
96                         <artifactId>hub-maven-plugin</artifactId>
97                         <version>1.4.0</version>
98                         <inherited>false</inherited>
99                         <configuration>
100                             <hubProjectName>${project.name}</hubProjectName>
101                             <outputDirectory>${project.basedir}</outputDirectory>
102                         </configuration>
103                         <executions>
104                             <execution>
105                                 <id>create-bdio-file</id>
106                                 <phase>package</phase>
107                                 <goals>
108                                     <goal>createHubOutput</goal>
109                                 </goals>
110                             </execution>
111                         </executions>
112                     </plugin>
113                 </plugins>
114             </build>
115         </profile>
116
117         <profile>
118                 <id>docker</id>
119                 <build>
120                         <plugins>
121                                 <plugin>
122                                         <groupId>com.spotify</groupId>
123                                         <artifactId>docker-maven-plugin</artifactId>
124                                         <version>0.4.11</version>
125                                         <executions>
126                                                 <execution>
127                                                         <id>push-images</id>
128                                                         <phase>${docker.build.phase}</phase>
129                                                         <goals>
130                                                                 <goal>build</goal>
131                                                                 <goal>push</goal>
132                                                         </goals>
133                                                 </execution>
134                                         </executions>
135                                         <configuration>
136                                                 <imageName>${docker.registry}/onap/ccsdk-apps-ms-neng:${project.version}</imageName>
137                                                 <dockerDirectory>target/docker</dockerDirectory>
138                                                 <serverId>docker-hub</serverId>
139                                                 <registryUrl>https://${docker.registry}</registryUrl>
140                                                 <imageTags>
141                                                         <imageTag>${project.version}</imageTag>
142                                                         <imageTag>${project.version}-STAGING-${maven.build.timestamp}</imageTag>
143                                                         <imageTag>${project.docker.latesttag.version}</imageTag>
144                                                 </imageTags>
145                                                 <forceTags>true</forceTags>
146                                                 <resources>
147                                                         <resource>
148                                                                 <targetPath>/</targetPath>
149                                                                 <directory>${project.build.directory}</directory>
150                                                                 <include>${project.build.finalName}.jar</include>
151                                                         </resource>
152                                                         <resource>
153                                                                 <targetPath>/</targetPath>
154                                                                 <directory>${project.build.directory}</directory>
155                                                                 <include>opt/etc/config/*</include>
156                                                         </resource>
157                                                         <resource>
158                                                                 <targetPath>/</targetPath>
159                                                                 <directory>${project.build.directory}</directory>
160                                                                 <include>opt/etc/keystore/*</include>
161                                                         </resource>
162                                                         <resource>
163                                                                 <targetPath>/</targetPath>
164                                                                 <directory>${project.build.directory}</directory>
165                                                                 <include>opt/etc/truststore/*</include>
166                                                         </resource>
167                                                         <resource>
168                                                                 <targetPath>/</targetPath>
169                                                                 <directory>${project.build.directory}</directory>
170                                                                 <include>opt/aai/keystore/*</include>
171                                                         </resource>
172                                                         <resource>
173                                                                 <targetPath>/</targetPath>
174                                                                 <directory>${project.build.directory}</directory>
175                                                                 <include>etc/*</include>
176                                                         </resource>
177                                                 </resources>
178                                         </configuration>
179                                 </plugin>
180                         </plugins>
181                 </build>
182         </profile>
183
184     </profiles>
185
186     <developers>
187         <developer>
188             <id>${userId}</id>
189         </developer>
190     </developers>
191    
192  
193     <parent>
194         <groupId>org.onap.ccsdk.parent</groupId>
195         <artifactId>odlparent-lite</artifactId>
196         <version>1.1.0-SNAPSHOT</version>
197         <relativePath />
198     </parent>
199
200     <dependencyManagement>
201         <dependencies>
202             <dependency>
203                 <groupId>org.springframework.boot</groupId>
204                 <artifactId>spring-boot-starter-parent</artifactId>
205                 <version>${springboot.version}</version>
206                 <type>pom</type>
207                 <scope>import</scope>
208             </dependency>
209         </dependencies>
210     </dependencyManagement>
211
212     <dependencies>
213         <dependency>
214             <groupId>io.swagger</groupId>
215             <artifactId>swagger-core</artifactId>
216             <version>1.5.20</version>
217         </dependency>
218         <dependency>
219             <groupId>org.springframework.boot</groupId>
220             <artifactId>spring-boot-starter-web</artifactId>
221             <version>${springboot.version}</version>
222         </dependency>
223         <dependency>
224             <groupId>org.springframework.boot</groupId>
225             <artifactId>spring-boot-starter-jersey</artifactId>
226             <version>${springboot.version}</version>
227         </dependency>
228         <dependency>
229             <groupId>org.springframework.boot</groupId>
230             <artifactId>spring-boot-starter-actuator</artifactId>
231             <version>${springboot.version}</version>
232         </dependency>
233         <dependency>
234             <groupId>org.springframework.boot</groupId>
235             <artifactId>spring-boot-loader-tools</artifactId>
236             <version>${springboot.version}</version>
237         </dependency>
238         <dependency>
239             <groupId>org.springframework.boot</groupId>
240             <artifactId>spring-boot-starter-test</artifactId>
241             <version>${springboot.version}</version>
242             <scope>test</scope>
243         </dependency>
244         <dependency>
245             <groupId>org.springframework.boot</groupId>
246             <artifactId>spring-boot-starter-tomcat</artifactId>
247             <version>${springboot.version}</version>
248             <scope>compile</scope>
249         </dependency>
250         <dependency>
251             <groupId>org.springframework.boot</groupId>
252             <artifactId>spring-boot-starter-data-jpa</artifactId>
253             <version>${springboot.version}</version>
254             <scope>compile</scope>
255         </dependency>
256         <dependency>
257             <groupId>org.apache.httpcomponents</groupId>
258             <artifactId>httpclient</artifactId>
259         </dependency>
260         <dependency>
261             <groupId>javax.ws.rs</groupId>
262             <artifactId>javax.ws.rs-api</artifactId>
263             <version>2.1</version>
264         </dependency>
265         <dependency>
266             <groupId>commons-lang</groupId>
267             <artifactId>commons-lang</artifactId>
268             <version>2.6</version>
269         </dependency>
270         <dependency>
271             <groupId>org.liquibase</groupId>
272             <artifactId>liquibase-core</artifactId>
273         </dependency>
274                 <dependency>
275                         <groupId>org.mariadb.jdbc</groupId>
276                         <artifactId>mariadb-java-client</artifactId>
277                         <version>${mariadb.connector.version}</version>
278                 </dependency>
279         <dependency>
280             <groupId>com.h2database</groupId>
281             <artifactId>h2</artifactId>
282         </dependency>
283         <dependency>
284             <groupId>org.springframework.boot</groupId>
285             <artifactId>spring-boot-configuration-processor</artifactId>
286             <version>${springboot.version}</version>
287             <optional>true</optional>
288         </dependency>
289         <dependency>
290             <groupId>org.springframework</groupId>
291             <artifactId>spring-test</artifactId>
292             <version>${spring.version}</version>
293             <scope>test</scope>
294         </dependency>
295         <dependency>
296             <groupId>org.springframework</groupId>
297             <artifactId>spring-aop</artifactId>
298             <version>${spring.version}</version>
299         </dependency>
300         <dependency>
301             <groupId>org.springframework</groupId>
302             <artifactId>spring-beans</artifactId>
303         </dependency>
304         <dependency>
305             <groupId>org.springframework</groupId>
306             <artifactId>spring-beans</artifactId>
307             <version>${spring.version}</version>
308         </dependency>
309         <dependency>
310             <groupId>org.springframework</groupId>
311             <artifactId>spring-context</artifactId>
312             <version>${spring.version}</version>
313         </dependency>
314         <dependency>
315             <groupId>org.springframework</groupId>
316             <artifactId>spring-core</artifactId>
317             <version>${spring.version}</version>
318         </dependency>
319         <dependency>
320             <groupId>org.springframework</groupId>
321             <artifactId>spring-expression</artifactId>
322             <version>${spring.version}</version>
323         </dependency>
324         <dependency>
325             <groupId>org.springframework</groupId>
326             <artifactId>spring-web</artifactId>
327             <version>${spring.version}</version>
328         </dependency>
329     </dependencies>
330
331     <build>
332         <finalName>NetworkElementNameGen</finalName>
333         <plugins>
334             <plugin>
335                 <groupId>org.codehaus.groovy.maven</groupId>
336                 <artifactId>gmaven-plugin</artifactId>
337                 <version>1.0</version>
338                 <executions>
339                     <execution>
340                         <phase>validate</phase>
341                         <goals>
342                             <goal>execute</goal>
343                         </goals>
344                         <configuration>
345                             <source>
346                                 println project.properties['ccsdk.project.version'];
347                                 def versionArray;
348                                 if (project.properties['ccsdk.project.version'] != null ) {
349                                     versionArray = project.properties['ccsdk.project.version'].split('\\.');
350                                 }
351
352                                 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
353                                 {
354                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
355                                 } else {
356                                     project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
357                                 }
358
359                                 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
360                             </source>
361                         </configuration>
362                     </execution>
363                 </executions>
364             </plugin>
365             <plugin>
366                 <groupId>org.jacoco</groupId>
367                 <artifactId>jacoco-maven-plugin</artifactId>
368                 <version>0.7.5.201505241946</version>
369                 <executions>
370                     <execution>
371                         <id>pre-unit-test</id>
372                         <goals>
373                             <goal>prepare-agent</goal>
374                         </goals>
375                         <configuration>
376                             <destFile>${sonar.jacoco.reportPath}</destFile>
377                             <propertyName>surefireArgLine</propertyName>
378                         </configuration>
379                     </execution>
380                     <execution>
381                         <id>post-unit-test</id>
382                         <phase>test</phase>
383                         <goals>
384                             <goal>report</goal>
385                         </goals>
386                         <configuration>
387                             <dataFile>${sonar.jacoco.reportPath}</dataFile>
388                             <outputDirectory>${jacoco.path}</outputDirectory>
389                         </configuration>
390                     </execution>
391                     <execution>
392                         <id>pre-integration-test</id>
393                         <phase>pre-integration-test</phase>
394                         <goals>
395                             <goal>prepare-agent</goal>
396                         </goals>
397                         <configuration>
398                             <destFile>${sonar.jacoco.itReportPath}</destFile>
399                             <propertyName>failsafeArgLine</propertyName>
400                         </configuration>
401                     </execution>
402                     <execution>
403                         <id>post-integration-test</id>
404                         <phase>post-integration-test</phase>
405                         <goals>
406                             <goal>report</goal>
407                         </goals>
408                         <configuration>
409                             <dataFile>${sonar.jacoco.itReportPath}/</dataFile>
410                             <outputDirectory>${jacoco.itPath}</outputDirectory>
411                         </configuration>
412                     </execution>
413                 </executions>
414             </plugin>
415             <plugin>
416                 <groupId>org.apache.maven.plugins</groupId>
417                 <artifactId>maven-surefire-plugin</artifactId>
418                 <configuration>
419                     <argLine>${surefireArgLine}</argLine>
420                     <skipTests>${skip.unit.tests}</skipTests>
421                     <excludes>
422                         <exclude>**/IT*.java</exclude>
423                     </excludes>
424                 </configuration>
425             </plugin>
426             <plugin>
427                 <groupId>org.apache.maven.plugins</groupId>
428                 <artifactId>maven-failsafe-plugin</artifactId>
429                 <executions>
430                     <execution>
431                         <id>integration-tests</id>
432                         <goals>
433                             <goal>integration-test</goal>
434                             <goal>verify</goal>
435                         </goals>
436                         <configuration>
437                             <argLine>${failsafeArgLine}</argLine>
438                             <skipTests>${skip.integration.tests}</skipTests>
439                         </configuration>
440                     </execution>
441                 </executions>
442             </plugin>
443             <plugin>
444                 <artifactId>maven-dependency-plugin</artifactId>
445             </plugin>
446             <plugin>
447                 <groupId>com.github.kongchen</groupId>
448                 <artifactId>swagger-maven-plugin</artifactId>
449                 <version>3.1.3</version>
450                 <configuration>
451                     <apiSources>
452                         <apiSource>
453                             <locations>org.onap.ccsdk.apps.ms.neng.service.rs</locations>
454                             <basePath>/web</basePath>
455                             <info>
456                                 <title>${project.artifactId} Service</title>
457                                 <version>${project.version}</version>
458                             </info>
459                             <swaggerDirectory>${swagger.directory}</swaggerDirectory>
460                         </apiSource>
461                     </apiSources>
462                 </configuration>
463                 <executions>
464                     <execution>
465                         <phase>package</phase>
466                         <goals>
467                             <goal>generate</goal>
468                         </goals>
469                     </execution>
470                 </executions>
471             </plugin>
472
473             <plugin>
474                 <artifactId>exec-maven-plugin</artifactId>
475                 <groupId>org.codehaus.mojo</groupId>
476             </plugin>
477             <!--
478             <plugin>
479                 <groupId>io.fabric8</groupId>
480                 <artifactId>docker-maven-plugin</artifactId>
481                 <inherited>false</inherited>
482                 <configuration>
483                     <verbose>false</verbose>
484                     <images>
485                         <image>
486                             <name>onap/ccsdk-apps-ms-neng</name>
487                             <build>
488                                 <cleanup>try</cleanup>
489                                 <dockerFileDir>${basedir}/src/main/docker</dockerFileDir>
490                                 <dockerFile>Dockerfile</dockerFile>
491                                 <tags>
492                                     <tag>${project.version}</tag>
493                                 </tags>
494
495                                <assembly>
496                                     <targetDir>/</targetDir>
497                                     <inline>
498                                         <files>
499                                             <file>
500                                                 <source>${project.build.directory}/${build.finalName}.${project.packaging}</source>
501                                             </file>
502                                         </files>
503                                         <fileSet>
504                                             <directory>${basedir}/opt/etc</directory>
505                                             <outputDirectory>opt/etc</outputDirectory>
506                                             <includes>
507                                                 <include>**</include>
508                                             </includes>
509                                         </fileSet>
510                                     </inline>
511                                 </assembly>
512
513
514                             </build>
515                         </image>
516                     </images>
517                 </configuration>
518                 <executions>
519                     <execution>
520                         <id>generate-images</id>
521                         <phase>package</phase>
522                         <goals>
523                             <goal>build</goal>
524                         </goals>
525                     </execution>
526
527                     <execution>
528                         <id>push-images</id>
529                         <phase>deploy</phase>
530                         <goals>
531                             <goal>build</goal>
532                             <goal>push</goal>
533                         </goals>
534                     </execution>
535                 </executions>
536             </plugin>
537             -->
538
539  
540             <plugin>
541                 <groupId>org.springframework.boot</groupId>
542                 <artifactId>spring-boot-maven-plugin</artifactId>
543                 <version>${springboot.version}</version>
544                 <executions>
545                     <execution>
546                         <goals>
547                             <goal>repackage</goal>
548                         </goals>
549                     </execution>
550                 </executions>
551             </plugin>
552         </plugins>
553         <resources>
554             <resource>
555                 <directory>src/main/docker</directory>
556                 <targetPath>../docker</targetPath>
557                 <filtering>true</filtering>
558                 <includes>
559                     <include>**/*</include>
560                 </includes>
561             </resource>
562             <resource>
563                 <directory>src/main/resources</directory>
564                 <filtering>true</filtering>
565                 <includes>
566                     <include>**/*</include>
567                 </includes>
568             </resource>
569             <resource>
570                 <directory>opt/aai/keystore</directory>
571                 <targetPath>../opt/aai/keystore</targetPath>
572                 <filtering>false</filtering>
573                 <includes>
574                     <include>**/*</include>
575                 </includes>
576             </resource>
577
578             <resource>
579                 <directory>opt/etc/config</directory>
580                 <targetPath>../opt/etc/config</targetPath>
581                 <filtering>true</filtering>
582                 <includes>
583                     <include>**/*</include>
584                 </includes>
585             </resource>
586             <resource>
587                 <directory>opt/etc/keystore</directory>
588                 <targetPath>../opt/etc/keystore</targetPath>
589                 <filtering>false</filtering>
590                 <includes>
591                     <include>**/*</include>
592                 </includes>
593             </resource>
594             <resource>
595                 <directory>opt/etc/truststore</directory>
596                 <targetPath>../opt/etc/truststore</targetPath>
597                 <filtering>false</filtering>
598                 <includes>
599                     <include>**/*</include>
600                 </includes>
601             </resource>
602         </resources>
603         <pluginManagement>
604             <plugins>
605                 <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
606                 <plugin>
607                     <groupId>org.eclipse.m2e</groupId>
608                     <artifactId>lifecycle-mapping</artifactId>
609                     <version>1.0.0</version>
610                     <configuration>
611                         <lifecycleMappingMetadata>
612                             <pluginExecutions>
613                                 <pluginExecution>
614                                     <pluginExecutionFilter>
615                                         <groupId>
616                                             org.apache.maven.plugins
617                                         </groupId>
618                                         <artifactId>
619                                             maven-checkstyle-plugin
620                                         </artifactId>
621                                         <versionRange>
622                                             [2.17,)
623                                         </versionRange>
624                                         <goals>
625                                             <goal>check</goal>
626                                         </goals>
627                                     </pluginExecutionFilter>
628                                     <action>
629                                         <ignore></ignore>
630                                     </action>
631                                 </pluginExecution>
632                                 <pluginExecution>
633                                     <pluginExecutionFilter>
634                                         <groupId>
635                                             org.codehaus.mojo
636                                         </groupId>
637                                         <artifactId>
638                                             properties-maven-plugin
639                                         </artifactId>
640                                         <versionRange>
641                                             [1.0.0,)
642                                         </versionRange>
643                                         <goals>
644                                             <goal>
645                                                 set-system-properties
646                                             </goal>
647                                         </goals>
648                                     </pluginExecutionFilter>
649                                     <action>
650                                         <ignore></ignore>
651                                     </action>
652                                 </pluginExecution>
653                             </pluginExecutions>
654                         </lifecycleMappingMetadata>
655                     </configuration>
656                 </plugin>
657             </plugins>
658         </pluginManagement>
659     </build>
660     
661 </project>
662