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