Config from docker env params
[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/collectors/ves/${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.0.4.RELEASE</version>
65                 </dependency>
66                 <dependency>
67                         <groupId>org.springframework.boot</groupId>
68                         <artifactId>spring-boot-starter-web</artifactId>
69                         <version>2.0.4.RELEASE</version>
70                 </dependency>
71
72                 <dependency>
73                         <groupId>org.springframework.boot</groupId>
74                         <artifactId>spring-boot-starter-test</artifactId>
75                         <version>2.0.3.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.0.3.RELEASE</version>
82                 </dependency>
83                 <dependency>
84                         <groupId>org.springframework</groupId>
85                         <artifactId>spring-core</artifactId>
86                         <version>5.0.5.RELEASE</version>
87                 </dependency>
88                 <dependency>
89                         <groupId>org.springframework</groupId>
90                         <artifactId>spring-expression</artifactId>
91                         <version>5.0.9.RELEASE</version>
92                 </dependency>
93                 <dependency>
94                         <groupId>org.postgresql</groupId>
95                         <artifactId>postgresql</artifactId>
96                         <scope>runtime</scope>
97                          <version>42.2.4</version>
98                 </dependency>
99                 <dependency>
100                         <groupId>org.springframework</groupId>
101                         <artifactId>spring-jdbc</artifactId>
102                         <version>4.3.11.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.1</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.1.1</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.0.0.RELEASE</version>
143                         </plugin>
144                         <plugin>
145                                 <groupId>org.springframework.boot</groupId>
146                                 <artifactId>spring-boot-maven-plugin</artifactId>
147                                 <version>2.0.0.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.1.1</version>
200                 <configuration>
201                     <serverId>${onap.nexus.dockerregistry.daily}</serverId>
202                     <imageName>${docker.image.name}</imageName>
203                     <imageTags>
204                         <tag>latest</tag>
205                     </imageTags>
206                     <baseImage>ubuntu:16.04</baseImage>
207                     <env>
208                         <HOSTALIASES>/etc/host.aliases</HOSTALIASES>
209                         <HOME>/opt/app/SnmpMapper</HOME>
210                     </env>
211                     <workdir>/opt/app/SnmpMapper</workdir>
212                     <resources>
213                         <resource>
214                             <targetPath>.</targetPath>
215  
216                             <directory>${project.build.directory}/${project.artifactId}-${project.version}</directory>
217                         </resource>
218                     </resources>
219                     <runs>
220                         <run>chmod +x bin/run.sh</run>
221                         <run>
222                             <![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]]>
223                         </run>
224                     </runs>
225                     <exposes>
226                         <expose>8080</expose>
227                     </exposes>
228                     <entryPoint>bin/run.sh</entryPoint>
229  
230                 </configuration>
231                 <executions>
232                     <execution>
233                         <id>build-image</id>
234                         <phase>package</phase>
235                         <goals>
236                             <goal>build</goal>
237                         </goals>
238                     </execution>
239                     <execution>
240                         <id>tag-and-push-image-latest</id>
241                         <phase>deploy</phase>
242                         <goals>
243                             <goal>tag</goal>
244                         </goals>
245                         <configuration>
246                             <image>${docker.image.name}:latest</image>
247                             <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName>
248                             <pushImage>true</pushImage>
249                         </configuration>
250                     </execution>
251                     <execution>
252                         <id>tag-and-push-image-with-version</id>
253                         <phase>deploy</phase>
254                         <goals>
255                             <goal>tag</goal>
256                         </goals>
257                         <configuration>
258                             <image>${docker.image.name}:latest</image>
259                             <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}
260                             </newName>
261                             <pushImage>true</pushImage>
262                         </configuration>
263                     </execution>
264                     <execution>
265                         <id>tag-and-push-image-with-version-and-date</id>
266                         <phase>deploy</phase>
267                         <goals>
268                             <goal>tag</goal>
269                         </goals>
270                         <configuration>
271                             <image>${docker.image.name}:latest</image>
272                             <newName>
273                                 ${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z
274                             </newName>
275                             <pushImage>true</pushImage>
276                         </configuration>
277                     </execution>
278                 </executions>
279             </plugin>
280             <plugin>
281                 <groupId>org.codehaus.mojo</groupId>
282                 <artifactId>build-helper-maven-plugin</artifactId>
283                 <version>1.9.1</version>
284                 <executions>
285                     <execution>
286                         <id>add-source</id>
287                         <phase>generate-sources</phase>
288                         <goals>
289                             <goal>add-source</goal>
290                         </goals>
291                         <configuration>
292                             <sources>
293                                 <source>src/gen/java</source>
294                             </sources>
295                         </configuration>
296                     </execution>
297                     <!-- <execution> <id>regex-property</id> <goals> <goal>regex-property</goal> 
298                         </goals> <configuration> <name>docker.version</name> <value>${project.version}</value> 
299                         <regex>(^[0-9]+.[0-9]+.[0-9]+$)</regex> <replacement>$1-STAGING</replacement> 
300                         <failIfNoMatch>false</failIfNoMatch> </configuration> </execution> -->
301                 </executions>
302             </plugin>
303         
304                 </plugins>
305                 <!-- <finalName>snmpmapper</finalName> -->
306         </build>
307         
308         
309     <profiles>
310         <profile>
311             <id>with-system-proxy</id>
312             <build>
313                 <plugins>
314                     <plugin>
315                         <groupId>com.spotify</groupId>
316                         <artifactId>docker-maven-plugin</artifactId>
317                         <configuration>
318                             <buildArgs>
319                                 <http_proxy>${env.http_proxy}</http_proxy>
320                             </buildArgs>
321                         </configuration>
322                     </plugin>
323  
324                 </plugins>
325  
326             </build>
327         </profile>
328     </profiles>
329  
330  
331     <repositories>
332         <repository>
333             <id>spring-releases</id>
334             <url>https://repo.spring.io/libs-release</url>
335         </repository>
336     </repositories>
337     <pluginRepositories>
338         <pluginRepository>
339             <id>spring-releases</id>
340             <url>https://repo.spring.io/libs-release</url>
341         </pluginRepository>
342     </pluginRepositories>
343
344
345 </project>