1ba3cfc5007e66bc0696844422ea6c1a08c79057
[ccsdk/apps.git] / ms / vlantag-api / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5         <modelVersion>4.0.0</modelVersion>
6
7         <groupId>org.onap.ccsdk.apps.ms.vlantagapi</groupId>
8         <artifactId>vlantag-api</artifactId>
9         <version>0.4.0-SNAPSHOT</version>
10         <packaging>jar</packaging>
11
12         <name>vlantag-api</name>
13         <description>Vlantag Api Service for Vlantag management of VNFs</description>
14
15         <properties>
16                 <swagger.directory>${basedir}/target/main/resources/META-INF/resources/swagger-ui/dist</swagger.directory>
17                 <swagger.annotations.version>1.5.8</swagger.annotations.version>
18                 <java.version>1.8</java.version>
19                 <springboot.version>2.0.4.RELEASE</springboot.version>
20                 <mariadb.connector.version>2.1.1</mariadb.connector.version>
21                 <ccsdk.sli.adaptors.version>0.3.1-SNAPSHOT</ccsdk.sli.adaptors.version>
22                 <docker.registry>TBD:5100</docker.registry>
23                 <serviceArtifactName>vlantagapi</serviceArtifactName>
24
25                 <!-- Sonar -->
26                 <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
27                 <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
28                 <sonar.surefire.reportsPath>${basedir}/target/surefire-reports</sonar.surefire.reportsPath>
29                 <sonar.failsafe.reportsPath>${basedir}/target/failsafe-reports</sonar.failsafe.reportsPath>
30                 <jacoco.path>${basedir}/target/jacoco_report</jacoco.path>
31                 <jacoco.itPath>${basedir}/target/jacoco_itReport</jacoco.itPath>
32                 <sonar.jacoco.reportPath>${basedir}/target/jacoco-ut.exec</sonar.jacoco.reportPath>
33                 <sonar.jacoco.itReportPath>${basedir}/target/jacoco-it.exec</sonar.jacoco.itReportPath>
34                 <sonar.language>java</sonar.language>
35                 <ilib.version>2.0.7</ilib.version>
36                 <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
37                 <docker.push.phase>deploy</docker.push.phase>
38                 <docker.verbose>true</docker.verbose>
39                 <ccsdk.project.version>${project.version}</ccsdk.project.version>
40         </properties>
41
42         <parent>
43                 <groupId>org.onap.ccsdk.parent</groupId>
44                 <artifactId>spring-boot-starter-parent</artifactId>
45                 <version>1.2.0-SNAPSHOT</version>
46                 <relativePath />
47         </parent>
48
49
50         <dependencies>
51                 <dependency>
52                         <groupId>org.springframework.boot</groupId>
53                         <artifactId>spring-boot-starter-jersey</artifactId>
54                 </dependency>
55                 <dependency>
56                         <groupId>org.springframework.boot</groupId>
57                         <artifactId>spring-boot-starter-web</artifactId>
58                 </dependency>
59                 <dependency>
60                         <groupId>org.springframework.boot</groupId>
61                         <artifactId>spring-boot-starter-test</artifactId>
62                         <scope>test</scope>
63                 </dependency>
64
65                 <dependency>
66                         <groupId>org.springframework.boot</groupId>
67                         <artifactId>spring-boot-starter-actuator</artifactId>
68                 </dependency>
69
70                 <dependency>
71                         <groupId>org.springframework.boot</groupId>
72                         <artifactId>spring-boot-starter-security</artifactId>
73                         <version>2.0.1.RELEASE</version>
74                 </dependency>
75
76                 <dependency>
77                         <groupId>org.onap.ccsdk.sli.adaptors</groupId>
78                         <artifactId>resource-assignment-provider</artifactId>
79                         <version>${ccsdk.sli.adaptors.version}</version>
80                         <exclusions>
81                                 <exclusion>
82                                         <groupId>org.slf4j</groupId>
83                                         <artifactId>slf4j-simple</artifactId>
84                                 </exclusion>
85                         </exclusions>
86                 </dependency>
87
88                 <dependency>
89                         <groupId>org.mariadb.jdbc</groupId>
90                         <artifactId>mariadb-java-client</artifactId>
91                         <version>${mariadb.connector.version}</version>
92                 </dependency>
93
94                 <dependency>
95                         <groupId>io.swagger</groupId>
96                         <artifactId>swagger-annotations</artifactId>
97                         <version>1.5.8</version>
98                 </dependency>
99         </dependencies>
100
101
102
103         <build>
104                 <plugins>
105             <plugin>
106                 <groupId>org.codehaus.groovy.maven</groupId>
107                 <artifactId>gmaven-plugin</artifactId>
108                 <version>1.0</version>
109                 <executions>
110                     <execution>
111                         <phase>validate</phase>
112                         <goals>
113                             <goal>execute</goal>
114                         </goals>
115                         <configuration>
116                             <source>
117                                 println project.properties['ccsdk.project.version'];
118                                 def versionArray;
119                                 if (project.properties['ccsdk.project.version'] != null ) {
120                                     versionArray = project.properties['ccsdk.project.version'].split('\\.');
121                                 }
122
123                                 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
124                                 {
125                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
126                                 } else {
127                                     project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
128                                 }
129
130                                 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
131                             </source>
132                         </configuration>
133                     </execution>
134                 </executions>
135             </plugin>
136                     <plugin>
137                 <groupId>org.apache.maven.plugins</groupId>
138                 <artifactId>maven-surefire-plugin</artifactId>
139                 <configuration>
140                     <argLine>${surefireArgLine}</argLine>
141                     <skipTests>${skip.unit.tests}</skipTests>
142                     <excludes>
143                         <exclude>**/IT*.java</exclude>
144                     </excludes>
145                 </configuration>
146             </plugin>
147                         <plugin>
148                                 <groupId>org.jacoco</groupId>
149                                 <artifactId>jacoco-maven-plugin</artifactId>
150                                 <version>0.7.5.201505241946</version>
151                                 <executions>
152                                         <!-- Prepares the property pointing to the JaCoCo runtime agent which 
153                                                 is passed as VM argument when Maven the Surefire plugin is executed. -->
154                                         <execution>
155                                                 <id>pre-unit-test</id>
156                                                 <goals>
157                                                         <goal>prepare-agent</goal>
158                                                 </goals>
159                                                 <configuration>
160                                                         <!-- Sets the path to the file which contains the execution data. -->
161                                                         <destFile>${sonar.jacoco.reportPath}</destFile>
162                                                         <propertyName>surefireArgLine</propertyName>
163                                                 </configuration>
164                                         </execution>
165                                         <!-- Ensures that the code coverage report for unit tests is created 
166                                                 after unit tests have been run. -->
167                                         <execution>
168                                                 <id>post-unit-test</id>
169                                                 <phase>test</phase>
170                                                 <goals>
171                                                         <goal>report</goal>
172                                                 </goals>
173                                                 <configuration>
174                                                         <!-- Sets the path to the file which contains the execution data. -->
175                                                         <dataFile>${sonar.jacoco.reportPath}</dataFile>
176                                                         <!-- Sets the output directory for the code coverage report. -->
177                                                         <outputDirectory>${jacoco.path}</outputDirectory>
178                                                 </configuration>
179                                         </execution>
180                                 </executions>
181                         </plugin>
182                         <plugin>
183                                 <groupId>com.github.kongchen</groupId>
184                                 <artifactId>swagger-maven-plugin</artifactId>
185                                 <version>3.1.7</version>
186                                 <configuration>
187                                         <apiSources>
188                                                 <apiSource>
189                                                         <schemes>
190                                                                 <scheme>http</scheme>
191                                                                 <scheme>https</scheme>
192                                                         </schemes>
193                                                         <host>localhost:9091</host>
194                                                         <locations>
195                                                                 <location>org.onap.ccsdk.apps.ms.vlantagapi.core.service</location>
196                                                                 <location>org.onap.ccsdk.apps.ms.vlantagapi.core.model</location>
197                                                         </locations>
198                                                         <!-- <locations>org.onap.ccsdk.apps.ms.vlantagapi.core.service</locations> -->
199                                                         <basePath>/vlantagapi</basePath>
200                                                         <info>
201                                                                 <title>${project.artifactId} Service</title>
202                                                                 <version>${project.version}</version>
203                                                         </info>
204                                                         <securityDefinitions>
205                                                                 <securityDefinition>
206                                                                         <name>basicAuth</name>
207                                                                         <type>basic</type>
208                                                                 </securityDefinition>
209                                                         </securityDefinitions>
210                                                         <swaggerDirectory>${swagger.directory}</swaggerDirectory>
211                                                 </apiSource>
212                                         </apiSources>
213                                 </configuration>
214                                 <executions>
215                                         <execution>
216                                                 <!-- <phase>compile</phase> -->
217                                                 <phase>package</phase>
218                                                 <goals>
219                                                         <goal>generate</goal>
220                                                 </goals>
221                                         </execution>
222                                 </executions>
223                         </plugin>
224                         <plugin>
225                                 <groupId>com.spotify</groupId>
226                                 <artifactId>docker-maven-plugin</artifactId>
227                                 <version>0.4.11</version>
228                                 <configuration>
229                                         <imageName>${docker.registry}/org.onap.ccsdk.apps/${serviceArtifactName}</imageName>
230                                         <dockerDirectory>src/main/docker</dockerDirectory>
231                                         <serverId>docker-hub</serverId>
232                                         <registryUrl>https://${docker.registry}</registryUrl>
233                                         <imageTags>
234                                                 <imageTag>${project.version}</imageTag>
235                                                 <imageTag>latest</imageTag>
236                                         </imageTags>
237                                         <forceTags>true</forceTags>
238                                         <resources>
239                                                 <resource>
240                                                         <targetPath>/</targetPath>
241                                                         <directory>${project.build.directory}</directory>
242                                                         <include>${project.build.finalName}.jar</include>
243                                                 </resource>
244                                         </resources>
245                                 </configuration>
246                         </plugin>
247                         <plugin>
248                                 <groupId>org.springframework.boot</groupId>
249                                 <artifactId>spring-boot-maven-plugin</artifactId>
250                                 <version>${springboot.version}</version>
251                                 <executions>
252                                         <execution>
253                                                 <goals>
254                                                         <goal>repackage</goal>
255                                                 </goals>
256                                         </execution>
257                                 </executions>
258                         </plugin>
259                 </plugins>
260         </build>
261
262         <profiles>
263                 <profile>
264                         <id>docker</id>
265                         <build>
266                                 <plugins>
267                                         <plugin>
268                                                 <groupId>com.spotify</groupId>
269                                                 <artifactId>docker-maven-plugin</artifactId>
270                                                 <version>0.4.11</version>
271                                                 <configuration>
272                                                         <imageName>${docker.registry}/org.onap.ccsdk.apps/${serviceArtifactName}</imageName>
273                                                         <dockerDirectory>src/main/docker</dockerDirectory>
274                                                         <serverId>docker-hub</serverId>
275                                                         <registryUrl>https://${docker.registry}</registryUrl>
276                                                         <imageTags>
277                                                                 <imageTag>${project.version}</imageTag>
278                                                                 <imageTag>${project.version}-STAGING-${maven.build.timestamp}</imageTag>
279                                                             <imageTag>${project.docker.latesttag.version}</imageTag>
280                                                         </imageTags>
281                                                         <forceTags>true</forceTags>
282                                                         <resources>
283                                                                 <resource>
284                                                                         <targetPath>/</targetPath>
285                                                                         <directory>${project.build.directory}</directory>
286                                                                         <include>${project.build.finalName}.jar</include>
287                                                                 </resource>
288                                                         </resources>
289                                                 </configuration>
290                                         </plugin>
291                                 </plugins>
292                         </build>
293                 </profile>
294         </profiles>
295
296
297 </project>