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