update docker plugin version
[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.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.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.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>${onap.nexus.dockerregistry.daily}/${docker.image.name}</imageName>
203                     <imageTags>
204                         <tag>latest</tag>
205                                                 <tag>${project.version}-${maven.build.timestamp}Z</tag>
206                                                 <tag>${project.version}</tag>
207                     </imageTags>
208                     <baseImage>ubuntu:16.04</baseImage>
209                     <env>
210                         <HOSTALIASES>/etc/host.aliases</HOSTALIASES>
211                         <HOME>/opt/app/SnmpMapper</HOME>
212                     </env>
213                     <workdir>/opt/app/SnmpMapper</workdir>
214                     <resources>
215                         <resource>
216                             <targetPath>.</targetPath>
217  
218                             <directory>${project.build.directory}/${project.artifactId}-${project.version}</directory>
219                         </resource>
220                     </resources>
221                     <runs>
222                         <run>chmod +x bin/run.sh</run>
223                         <run>
224                             <![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]]>
225                         </run>
226                     </runs>
227                     <exposes>
228                         <expose>8080</expose>
229                     </exposes>
230                     <entryPoint>bin/run.sh</entryPoint>
231  
232                 </configuration>
233                 <!--<executions>
234                     <execution>
235                         <id>build-image</id>
236                         <phase>package</phase>
237                         <goals>
238                             <goal>build</goal>
239                         </goals>
240                     </execution>
241                     <execution>
242                         <id>tag-and-push-image-latest</id>
243                         <phase>deploy</phase>
244                         <goals>
245                             <goal>tag</goal>
246                         </goals>
247                         <configuration>
248                             <image>${docker.image.name}:latest</image>
249                             <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName>
250                             <pushImage>true</pushImage>
251                         </configuration>
252                     </execution>
253                     <execution>
254                         <id>tag-and-push-image-with-version</id>
255                         <phase>deploy</phase>
256                         <goals>
257                             <goal>tag</goal>
258                         </goals>
259                         <configuration>
260                             <image>${docker.image.name}:latest</image>
261                             <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}
262                             </newName>
263                             <pushImage>true</pushImage>
264                         </configuration>
265                     </execution>
266                     <execution>
267                         <id>tag-and-push-image-with-version-and-date</id>
268                         <phase>deploy</phase>
269                         <goals>
270                             <goal>tag</goal>
271                         </goals>
272                         <configuration>
273                             <image>${docker.image.name}:latest</image>
274                             <newName>
275                                 ${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z
276                             </newName>
277                             <pushImage>true</pushImage>
278                         </configuration>
279                     </execution>
280                 </executions>-->
281             </plugin>
282             <plugin>
283                 <groupId>org.codehaus.mojo</groupId>
284                 <artifactId>build-helper-maven-plugin</artifactId>
285                 <version>1.9.1</version>
286                 <executions>
287                     <execution>
288                         <id>add-source</id>
289                         <phase>generate-sources</phase>
290                         <goals>
291                             <goal>add-source</goal>
292                         </goals>
293                         <configuration>
294                             <sources>
295                                 <source>src/gen/java</source>
296                             </sources>
297                         </configuration>
298                     </execution>
299                     <!-- <execution> <id>regex-property</id> <goals> <goal>regex-property</goal> 
300                         </goals> <configuration> <name>docker.version</name> <value>${project.version}</value> 
301                         <regex>(^[0-9]+.[0-9]+.[0-9]+$)</regex> <replacement>$1-STAGING</replacement> 
302                         <failIfNoMatch>false</failIfNoMatch> </configuration> </execution> -->
303                 </executions>
304             </plugin>
305         
306                 </plugins>
307                 <!-- <finalName>snmpmapper</finalName> -->
308         </build>
309         
310         
311     <profiles>
312         <profile>
313             <id>with-system-proxy</id>
314             <build>
315                 <plugins>
316                     <plugin>
317                         <groupId>com.spotify</groupId>
318                         <artifactId>docker-maven-plugin</artifactId>
319                         <configuration>
320                             <buildArgs>
321                                 <http_proxy>${env.http_proxy}</http_proxy>
322                             </buildArgs>
323                         </configuration>
324                     </plugin>
325  
326                 </plugins>
327  
328             </build>
329         </profile>
330     </profiles>
331  
332  
333     <repositories>
334         <repository>
335             <id>spring-releases</id>
336             <url>https://repo.spring.io/libs-release</url>
337         </repository>
338     </repositories>
339     <pluginRepositories>
340         <pluginRepository>
341             <id>spring-releases</id>
342             <url>https://repo.spring.io/libs-release</url>
343         </pluginRepository>
344     </pluginRepositories>
345
346
347 </project>