[DCAEGEN2] Release dcaegen2-services-mapper container
[dcaegen2/services/mapper.git] / snmpmapper / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 * ============LICENSE_START=======================================================
4 * ONAP : DCAEGEN2/services/mapper
5 * ================================================================================
6 * Copyright 2018 TechMahindra
7 * Copyright (C) 2023 Deutsche Telekom AG. All rights reserved.
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 * * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and * limitations under the License.
17 * ============LICENSE_END=========================================================
18  -->
19 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21     <modelVersion>4.0.0</modelVersion>
22
23     <groupId>org.onap.dcaegen2.services.mapper</groupId>
24     <artifactId>snmpmapper</artifactId>
25     <version>0.1.0-SNAPSHOT</version>
26     <packaging>jar</packaging>
27
28     <name>snmpmapper</name>
29     <description>saves mapping file to potsgresql database</description>
30
31     <parent>
32         <groupId>org.onap.dcaegen2.services.mapper</groupId>
33         <artifactId>mapper</artifactId>
34         <version>1.5.0-SNAPSHOT</version>
35     </parent>
36
37     <properties>
38         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
39         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
40         <java.version>11</java.version>
41     
42
43     <docker.image.name>onap/org.onap.dcaegen2.services.mapper.snmpmapper</docker.image.name>
44
45         <!-- TEST SETTINGS -->
46         <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
47
48         <!-- PLUGIN SETTINGS -->
49         <dependency.locations.enabled>false</dependency.locations.enabled>
50
51         <!-- NEXUS RELATED SETTINGS -->
52         <nexusproxy>https://nexus.onap.org</nexusproxy>
53         <snapshots.path>content/repositories/snapshots/</snapshots.path>
54         <releases.path>content/repositories/releases/</releases.path>
55         <site.path>
56             content/sites/site/org/onap/dcaegen2/services/mapper/${project.artifactId}/${project.version}
57         </site.path>
58         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
59     </properties>
60     <dependencies>
61 <!--    <dependency>
62         <groupId>org.springframework.webflow</groupId>
63         <artifactId>spring-webflow</artifactId>
64         <version>2.5.0.RELEASE</version>
65     </dependency> -->
66
67         <dependency>
68             <groupId>org.springframework.boot</groupId>
69             <artifactId>spring-boot-starter-thymeleaf</artifactId>
70             <version>2.1.1.RELEASE</version>
71         </dependency>
72         <dependency>
73             <groupId>org.springframework.boot</groupId>
74             <artifactId>spring-boot-starter-web</artifactId>
75             <version>2.1.1.RELEASE</version>
76         </dependency>
77
78         <dependency>
79             <groupId>org.springframework.boot</groupId>
80             <artifactId>spring-boot-starter-test</artifactId>
81             <version>2.1.1.RELEASE</version>
82             <scope>test</scope>
83         </dependency>
84         <dependency>
85             <groupId>org.springframework.boot</groupId>
86             <artifactId>spring-boot-starter-data-jpa</artifactId>
87             <version>2.1.1.RELEASE</version>
88         </dependency>
89         <dependency>
90             <groupId>org.springframework</groupId>
91             <artifactId>spring-core</artifactId>
92             <version>5.1.3.RELEASE</version>
93         </dependency>
94         <dependency>
95             <groupId>org.springframework</groupId>
96             <artifactId>spring-expression</artifactId>
97             <version>5.1.3.RELEASE</version>
98         </dependency>
99         <dependency>
100             <groupId>org.postgresql</groupId>
101             <artifactId>postgresql</artifactId>
102             <scope>runtime</scope>
103             <version>42.5.1</version>
104         </dependency>
105         <dependency>
106             <groupId>org.springframework</groupId>
107             <artifactId>spring-jdbc</artifactId>
108             <version>5.1.3.RELEASE</version>
109         </dependency>
110         <dependency>
111             <groupId>javax.servlet</groupId>
112             <artifactId>servlet-api</artifactId>
113             <version>3.0-alpha-1</version>
114         </dependency>
115         <dependency>
116             <groupId>javax.servlet.jsp</groupId>
117             <artifactId>jsp-api</artifactId>
118             <version>2.2</version>
119             </dependency>
120         <!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
121 <dependency>
122     <groupId>commons-fileupload</groupId>
123     <artifactId>commons-fileupload</artifactId>
124     <version>1.3.3</version>
125 </dependency>
126
127     </dependencies>
128
129     <build>
130         
131         <pluginManagement>
132             <plugins>
133                 <plugin>
134                     <artifactId>maven-assembly-plugin</artifactId>
135                     <version>3.1.0</version>
136                 </plugin>
137                 <plugin>
138                     <groupId>com.spotify</groupId>
139                     <artifactId>docker-maven-plugin</artifactId>
140                     <version>1.0.0</version>
141                 </plugin>
142             </plugins>
143         </pluginManagement>
144         <plugins>
145             <plugin>
146                 <groupId>org.springframework.boot</groupId>
147                 <artifactId>spring-boot-maven-plugin</artifactId>
148                 <version>2.1.1.RELEASE</version>
149             </plugin>
150             <plugin>
151                 <groupId>org.springframework.boot</groupId>
152                 <artifactId>spring-boot-maven-plugin</artifactId>
153                 <version>2.1.1.RELEASE</version>
154                 <executions>
155                     <execution>
156                         <goals>
157                             <goal>repackage</goal>
158                         </goals>
159                         <configuration>
160                             <mainClass>org.onap.dcaegen2.services.mapper.snmpmapper.SnmpmapperApplication</mainClass>
161                         </configuration>
162                     </execution>
163                 </executions>
164             </plugin>
165             <plugin>
166                 <artifactId>maven-jar-plugin</artifactId>
167                 <configuration>
168                     <archive>
169                         <manifest>
170                             <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
171                         </manifest>
172                         <manifestEntries>
173                             <Implementation-Build-Version>${project.version}</Implementation-Build-Version>
174                         </manifestEntries>
175                     </archive>
176                 </configuration>
177             </plugin>
178             <plugin>
179
180                 <artifactId>maven-assembly-plugin</artifactId>
181                 <configuration>
182                     <descriptors>
183                         <descriptor>src/assembly/dep.xml</descriptor>
184                     </descriptors>
185                     <attach>false</attach>
186                     <appendAssemblyId>false</appendAssemblyId>
187                     <updateOnly>true</updateOnly>
188                 </configuration>
189                 <executions>
190                     <execution>
191                         <id>make-assembly</id>
192                         <phase>package</phase>
193                         <goals>
194                             <goal>single</goal>
195                         </goals>
196                     </execution>
197                 </executions>
198             </plugin>
199
200             <!-- Spotify plugin to build and push docker image -->
201
202             <plugin>
203                 <groupId>com.spotify</groupId>
204                 <artifactId>docker-maven-plugin</artifactId>
205                 <version>1.0.0</version>
206                 <configuration>
207                     <skipDockerBuild>false</skipDockerBuild> 
208                     <serverId>${onap.nexus.dockerregistry.daily}</serverId>
209                     <imageName>${onap.nexus.dockerregistry.daily}/${docker.image.name}</imageName>
210                     <imageTags>
211                                 <tag>latest</tag>
212                 <tag>${project.version}-${maven.build.timestamp}Z</tag>
213                 <tag>${project.version}</tag>
214                     </imageTags>
215                     <baseImage>ubuntu:16.04</baseImage>
216                     <env>
217                     <HOSTALIASES>/etc/host.aliases</HOSTALIASES>
218             <HOME>/opt/app/SnmpMapper</HOME>
219                     </env>
220                     <workdir>/opt/app/SnmpMapper</workdir>
221                     <resources>
222                         <resource>
223                             <targetPath>.</targetPath>
224  
225                             <directory>${project.build.directory}/${project.artifactId}-${project.version}</directory>
226                         </resource>
227                     </resources>
228                     <runs>
229                         <run>chmod +x bin/run.sh</run>
230                         <run>
231                             <![CDATA[apt-get update && apt-get install -y curl && apt-get install -y openjdk-8-jdk  && apt-get install -y vim && apt-get clean all]]>
232                         </run>
233                     </runs>
234                     <exposes>
235                         <expose>8080</expose>
236                     </exposes>
237                     <entryPoint>bin/run.sh</entryPoint>
238  
239                 </configuration>
240                 <!--<executions>
241                     <execution>
242                         <id>build-image</id>
243                         <phase>package</phase>
244                         <goals>
245                             <goal>build</goal>
246                         </goals>
247                     </execution>
248                     <execution>
249                         <id>tag-and-push-image-latest</id>
250                         <phase>deploy</phase>
251                         <goals>
252                             <goal>tag</goal>
253                         </goals>
254                         <configuration>
255                             <image>${docker.image.name}:latest</image>
256                             <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName>
257                             <pushImage>true</pushImage>
258                         </configuration>
259                     </execution>
260                     <execution>
261                         <id>tag-and-push-image-with-version</id>
262                         <phase>deploy</phase>
263                         <goals>
264                             <goal>tag</goal>
265                         </goals>
266                         <configuration>
267                             <image>${docker.image.name}:latest</image>
268                             <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}
269                             </newName>
270                             <pushImage>true</pushImage>
271                         </configuration>
272                     </execution>
273                     <execution>
274                         <id>tag-and-push-image-with-version-and-date</id>
275                         <phase>deploy</phase>
276                         <goals>
277                             <goal>tag</goal>
278                         </goals>
279                         <configuration>
280                             <image>${docker.image.name}:latest</image>
281                             <newName>
282                                 ${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z
283                             </newName>
284                             <pushImage>true</pushImage>
285                         </configuration>
286                     </execution>
287                 </executions>-->
288             </plugin>
289             <plugin>
290                 <groupId>org.codehaus.mojo</groupId>
291                 <artifactId>build-helper-maven-plugin</artifactId>
292                 <version>1.9.1</version>
293                 <executions>
294                     <execution>
295                         <id>add-source</id>
296                         <phase>generate-sources</phase>
297                         <goals>
298                             <goal>add-source</goal>
299                         </goals>
300                         <configuration>
301                             <sources>
302                                 <source>src/gen/java</source>
303                             </sources>
304                         </configuration>
305                     </execution>
306                     <!-- <execution> <id>regex-property</id> <goals> <goal>regex-property</goal> 
307                         </goals> <configuration> <name>docker.version</name> <value>${project.version}</value> 
308                         <regex>(^[0-9]+.[0-9]+.[0-9]+$)</regex> <replacement>$1-STAGING</replacement> 
309                         <failIfNoMatch>false</failIfNoMatch> </configuration> </execution> -->
310                 </executions>
311             </plugin>
312     
313         </plugins>
314         <!-- <finalName>snmpmapper</finalName> -->
315     </build>
316     
317     
318     <profiles>
319         <profile>
320             <id>with-system-proxy</id>
321             <build>
322                 <plugins>
323                     <plugin>
324                         <groupId>com.spotify</groupId>
325                         <artifactId>docker-maven-plugin</artifactId>
326                         <configuration>
327                             <buildArgs>
328                                 <http_proxy>${env.http_proxy}</http_proxy>
329                             </buildArgs>
330                         </configuration>
331                     </plugin>
332  
333                 </plugins>
334  
335             </build>
336         </profile>
337     </profiles>
338  
339  
340     <repositories>
341         <repository>
342             <id>spring-releases</id>
343             <url>https://repo.spring.io/libs-release</url>
344         </repository>
345     </repositories>
346     <pluginRepositories>
347         <pluginRepository>
348             <id>spring-releases</id>
349             <url>https://repo.spring.io/libs-release</url>
350         </pluginRepository>
351     </pluginRepositories>
352
353
354 </project>