Fix bugs and formatting issues
[dcaegen2/services/son-handler.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- 
3 /*******************************************************************************
4  *  ============LICENSE_START=======================================================
5  *  son-handler
6  *  ================================================================================
7  *   Copyright (C) 2019 Wipro Limited.
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   -->
24 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
26         <modelVersion>4.0.0</modelVersion>
27         <groupId>org.onap.dcaegen2.services.son-handler</groupId>
28         <artifactId>son-handler</artifactId>
29         <name>dcaegen2-services-son-handler</name>
30         <version>1.0.0-SNAPSHOT</version>
31
32         <!--parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> 
33                 <version>2.0.4.RELEASE</version> </parent -->
34
35         <parent>
36                 <groupId>org.onap.oparent</groupId>
37                 <artifactId>oparent</artifactId>
38                 <version>1.2.1</version>
39                 <relativePath />
40         </parent>
41
42
43         <properties>
44                 <sdk.version>1.1.4</sdk.version>
45                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46                 <maven.compiler.source>1.8</maven.compiler.source>
47                 <maven.compiler.target>1.8</maven.compiler.target>
48                 <docker.image.name>onap/org.onap.dcaegen2.services.son-handler</docker.image.name>
49                 <!-- NEXUS RELATED SETTINGS -->
50                 <nexusproxy>https://nexus.onap.org</nexusproxy>
51                 <snapshots.path>content/repositories/snapshots/</snapshots.path>
52                 <releases.path>content/repositories/releases/</releases.path>
53                 <site.path>content/sites/site/org/onap/dcaegen2/services/son-handler/${project.artifactId}/${project.version}</site.path>
54                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
55         </properties>
56
57         <dependencies>
58                 <!-- cbs client -->
59                 <dependency>
60                         <groupId>org.onap.dcaegen2.services.sdk.rest.services</groupId>
61                         <artifactId>cbs-client</artifactId>
62                         <version>${sdk.version}</version>
63                 </dependency>
64
65                 <dependency>
66                         <groupId>org.onap.dcaegen2.services.sdk.security.crypt</groupId>
67                         <artifactId>crypt-password</artifactId>
68                         <version>${sdk.version}</version>
69                 </dependency>
70                 <dependency>
71                         <!-- Import dependency management from Spring Boot -->
72                         <groupId>org.springframework.boot</groupId>
73                         <artifactId>spring-boot-dependencies</artifactId>
74                         <version>2.0.4.RELEASE</version>
75                         <type>pom</type>
76                         <scope>import</scope>
77                 </dependency>
78                 <dependency>
79                         <groupId>com.att.nsa</groupId>
80                         <artifactId>cambriaClient</artifactId>
81                         <version>0.0.1</version>
82                 </dependency>
83                 <dependency>
84                         <groupId>junit</groupId>
85                         <artifactId>junit</artifactId>
86                         <scope>test</scope>
87                 </dependency>
88                 <dependency>
89                         <groupId>com.fasterxml.jackson.core</groupId>
90                         <artifactId>jackson-core</artifactId>
91                         <version>2.9.8</version>
92                 </dependency>
93                 <dependency>
94                         <groupId>com.fasterxml.jackson.core</groupId>
95                         <artifactId>jackson-databind</artifactId>
96                         <version>2.9.8</version>
97                 </dependency>
98                 <!-- https://mvnrepository.com/artifact/javax.json/javax.json-api -->
99                 <dependency>
100                         <groupId>javax.json</groupId>
101                         <artifactId>javax.json-api</artifactId>
102                         <version>1.1.2</version>
103                 </dependency>
104                 <dependency>
105                         <groupId>org.springframework.boot</groupId>
106                         <artifactId>spring-boot-starter-web</artifactId>
107                         <version>2.0.4.RELEASE</version>
108                 </dependency>
109                 <dependency>
110                         <groupId>org.postgresql</groupId>
111                         <artifactId>postgresql</artifactId>
112                         <version>42.2.5</version>
113                 </dependency>
114                 <dependency>
115                         <groupId>org.springframework.boot</groupId>
116                         <artifactId>spring-boot-starter-data-jpa</artifactId>
117                         <version>2.0.4.RELEASE</version>
118                 </dependency>
119                 <dependency>
120                         <groupId>org.springframework.data</groupId>
121                         <artifactId>spring-data-commons-core</artifactId>
122                         <version>1.4.0.RELEASE</version>
123                 </dependency>
124
125
126
127                 <!-- https://mvnrepository.com/artifact/org.codehaus.jackson/jackson-mapper-asl -->
128                 <dependency>
129                         <groupId>org.codehaus.jackson</groupId>
130                         <artifactId>jackson-mapper-asl</artifactId>
131                         <version>1.9.13</version>
132                 </dependency>
133                 <dependency>
134                         <groupId>org.hibernate.javax.persistence</groupId>
135                         <artifactId>hibernate-jpa-2.0-api</artifactId>
136                         <version>1.0.1.Final</version>
137                 </dependency>
138                 <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
139                 <dependency>
140                         <groupId>org.springframework</groupId>
141                         <artifactId>spring-beans</artifactId>
142                         <version>5.0.10.RELEASE</version>
143                 </dependency>
144
145                 <dependency>
146                         <groupId>org.springframework.boot</groupId>
147                         <artifactId>spring-boot-starter-test</artifactId>
148                         <version>2.0.4.RELEASE</version>
149                         <scope>test</scope>
150                         <!-- exclusions> <exclusion> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> 
151                                 </exclusion> </exclusions -->
152                 </dependency>
153                 <!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
154
155                 <dependency>
156                         <groupId>org.mockito</groupId>
157                         <artifactId>mockito-core</artifactId>
158                         <version>1.10.16</version>
159                         <scope>test</scope>
160                 </dependency>
161
162
163                 <dependency>
164                         <groupId>junit</groupId>
165                         <artifactId>junit</artifactId>
166                         <version>4.12</version>
167                         <scope>test</scope>
168                 </dependency>
169                 <!-- https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4 -->
170                 <!-- https://mvnrepository.com/artifact/org.powermock/powermock-api-mockito -->
171                 <dependency>
172                         <groupId>org.powermock</groupId>
173                         <artifactId>powermock-api-mockito</artifactId>
174                         <version>1.6.4</version>
175                         <scope>test</scope>
176                 </dependency>
177                 <!-- https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4 -->
178                 <dependency>
179                         <groupId>org.powermock</groupId>
180                         <artifactId>powermock-module-junit4</artifactId>
181                         <version>1.6.4</version>
182                         <scope>test</scope>
183                 </dependency>
184
185                 <dependency>
186                         <groupId>org.functionaljava</groupId>
187                         <artifactId>functionaljava</artifactId>
188                         <version>3.0</version>
189                 </dependency>
190
191
192         </dependencies>
193
194         <build>
195                 <plugins>
196                         <plugin>
197                                 <artifactId>maven-checkstyle-plugin</artifactId>
198                                 <executions>
199                                         <execution>
200                                                 <id>onap-java-style</id>
201                                                 <goals>
202                                                         <goal>check</goal>
203                                                 </goals>
204                                                 <phase>process-sources</phase>
205                                                 <configuration>
206                                                         <!-- Use Google Java Style Guide: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml 
207                                                                 with minor changes -->
208                                                         <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
209                                                         <!-- <sourceDirectory> is needed so that checkstyle ignores the generated 
210                                                                 sources directory -->
211                                                         <sourceDirectories>
212                                                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
213                                                         </sourceDirectories>
214                                                         <includeResources>true</includeResources>
215                                                         <includeTestSourceDirectory>false</includeTestSourceDirectory>
216                                                         <includeTestResources>false</includeTestResources>
217                                                         <excludes>
218                                                         </excludes>
219                                                         <consoleOutput>true</consoleOutput>
220                                                         <failsOnViolation>false</failsOnViolation>
221                                                         <violationSeverity>warning</violationSeverity>
222                                                 </configuration>
223                                         </execution>
224                                 </executions>
225                                 <dependencies>
226                                         <dependency>
227                                                 <groupId>org.onap.oparent</groupId>
228                                                 <artifactId>checkstyle</artifactId>
229                                                 <version>1.2.3</version>
230                                                 <scope>compile</scope>
231                                         </dependency>
232                                 </dependencies>
233                         </plugin>
234                         <!--plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> 
235                                 <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> 
236                                 <pluginExecutionFilter> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> 
237                                 <versionRange>2.17,)</versionRange> <goals> <goal>check</goal> </goals> </pluginExecutionFilter> 
238                                 <action> <ignore /> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> 
239                                 </configuration> </plugin -->
240                         <plugin>
241                                 <groupId>org.springframework.boot</groupId>
242                                 <artifactId>spring-boot-maven-plugin</artifactId>
243                                 <version>2.0.4.RELEASE</version>
244                                 <executions>
245                                         <execution>
246                                                 <goals>
247                                                         <goal>repackage</goal>
248                                                 </goals>
249                                         </execution>
250                                 </executions>
251                         </plugin>
252                         <plugin>
253                                 <groupId>com.spotify</groupId>
254                                 <artifactId>docker-maven-plugin</artifactId>
255                                 <configuration>
256                                         <serverId>${onap.nexus.dockerregistry.daily}</serverId>
257
258                                         <imageName>${docker.image.name}</imageName>
259                                         <imageTags>
260                                                 <tag>latest</tag>
261                                         </imageTags>
262                                         <baseImage>java:openjdk-8</baseImage>
263                                         <user>sonhms</user>
264                                         <resources>
265                                                 <resource>
266                                                         <targetPath>/bin</targetPath>
267                                                         <directory>${project.build.directory}</directory>
268                                                         <include>${project.artifactId}-${project.version}.jar</include>
269                                                 </resource>
270                                                 <resource>
271                                                         <targetPath>/bin</targetPath>
272                                                         <directory>${project.basedir}</directory>
273                                                         <include>entrypoint.sh</include>
274                                                 </resource>
275                                         </resources>
276                                         <runs>
277                                                 <!-- Maven is loosing file permissions during artifacts copy -->
278                                             <run>adduser --disabled-password sonhms </run>
279                                                 <run>chmod +x /bin/entrypoint.sh</run>
280                                                 <run>mv /bin/*.jar /bin/application.jar</run>
281                                                 <run>chmod -R 777 /bin</run>
282                                         </runs>
283                                         <exposes>
284                                                 <expose>8080</expose>
285                                         </exposes>
286                                         <entryPoint>/bin/entrypoint.sh</entryPoint>
287                                 </configuration>
288                                 <executions>
289                                         <execution>
290                                                 <id>build-image</id>
291                                                 <phase>package</phase>
292                                                 <goals>
293                                                         <goal>build</goal>
294                                                 </goals>
295                                         </execution>
296                                         <execution>
297                                                 <id>tag-and-push-image-latest</id>
298                                                 <phase>deploy</phase>
299                                                 <goals>
300                                                         <goal>tag</goal>
301                                                 </goals>
302                                                 <configuration>
303                                                         <image>${docker.image.name}:latest</image>
304                                                         <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName>
305                                                         <pushImage>true</pushImage>
306                                                 </configuration>
307                                         </execution>
308                                         <execution>
309                                                 <id>tag-and-push-image-with-version</id>
310                                                 <phase>deploy</phase>
311                                                 <goals>
312                                                         <goal>tag</goal>
313                                                 </goals>
314                                                 <configuration>
315                                                         <image>${docker.image.name}:latest</image>
316                                                         <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}</newName>
317                                                         <pushImage>true</pushImage>
318                                                 </configuration>
319                                         </execution>
320                                         <execution>
321                                                 <id>tag-and-push-image-with-version-and-date</id>
322                                                 <phase>deploy</phase>
323                                                 <goals>
324                                                         <goal>tag</goal>
325                                                 </goals>
326                                                 <configuration>
327                                                         <image>${docker.image.name}:latest</image>
328                                                         <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z</newName>
329                                                         <pushImage>true</pushImage>
330                                                 </configuration>
331                                         </execution>
332                                 </executions>
333                         </plugin>
334                 </plugins>
335         </build>
336 </project>
337
338