blob: 33c7c17b68ea8a7557d5afd3c73ab5f66464d71f [file] [log] [blame]
Dan Timoneydc0d02e2017-09-01 13:45:40 -04001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright (c) 2016-2017 Huawei Technologies Co., Ltd.
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18 <modelVersion>4.0.0</modelVersion>
Dan Timoneydc0d02e2017-09-01 13:45:40 -040019 <groupId>org.onap.oparent</groupId>
20 <artifactId>oparent-odlparent</artifactId>
21 <version>1.0.0-SNAPSHOT</version>
22 <name>oparent/odlparent-carbon</name>
23 <packaging>pom</packaging>
Dan Timoney186488b2017-10-06 15:06:32 -040024 <parent>
25 <groupId>org.opendaylight.odlparent</groupId>
26 <artifactId>odlparent</artifactId>
27 <version>1.8.1-Carbon</version>
28 </parent>
Dan Timoneydc0d02e2017-09-01 13:45:40 -040029 <properties>
30 <!--- properties from oparent/version -->
31 <maven.compiler.source>1.8</maven.compiler.source>
32 <maven.compiler.target>1.8</maven.compiler.target>
33 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
35 <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
36 <!-- sitePath may be overridden in the inheriting POM if desired -->
37 <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath>
38 <!--- end of properties from oparent/version -->
39 <jacoco.version>0.7.7.201606060606</jacoco.version>
40 <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
41 <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
42 <!-- Default Sonar configuration -->
43 <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
44 <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
45 <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
46 <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
47 <!-- If following file exist, auto-generation of swagger.json will be done -->
48 <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties>
49
50 <!-- If following file exist, auto-generation of sdk will be done -->
51 <swagger-json>${basedir}/src/main/resources/swagger.json</swagger-json>
52 </properties>
53
54 <profiles>
55 <profile>
56 <id>generate-json</id>
57 <activation>
58 <file>
59 <exists>${swagger-properties}</exists>
60 </file>
61 <property>
62 <name>swagger-sdk.generate-json</name>
63 </property>
64 </activation>
65 <build>
66 <plugins>
67 <plugin>
68 <groupId>org.codehaus.mojo</groupId>
69 <artifactId>properties-maven-plugin</artifactId>
70 <version>1.0.0</version>
71 <executions>
72 <execution>
73 <phase>initialize</phase>
74 <goals>
75 <goal>read-project-properties</goal>
76 </goals>
77 <configuration>
78 <files>
79 <file>${basedir}/src/main/resources/swagger.properties</file>
80 </files>
81 </configuration>
82 </execution>
83 </executions>
84 </plugin>
85 <plugin>
86 <groupId>com.github.kongchen</groupId>
87 <artifactId>swagger-maven-plugin</artifactId>
88 <version>3.1.4</version>
89 <configuration>
90 <apiSources>
91 <apiSource>
92 <locations>${api-rest-package}</locations>
93 <schemes>http,https</schemes>
94 <host>${api-host-ip}:${api-host-port}</host>
95 <basePath>${api-base-path}</basePath>
96 <info>
97 <title>${api-title}</title>
98 <version>${api-version}</version>
99 <description>${api-description}</description>
100 <license>
101 <name>${api-license}</name>
102 </license>
103 </info>
104 <swaggerDirectory>${basedir}/src/main/resources</swaggerDirectory>
105 </apiSource>
106 </apiSources>
107 </configuration>
108 <executions>
109 <execution>
110 <phase>compile</phase>
111 <goals>
112 <goal>generate</goal>
113 </goals>
114 </execution>
115 </executions>
116 </plugin>
117 <plugin>
118 <groupId>org.apache.maven.plugins</groupId>
119 <artifactId>maven-install-plugin</artifactId>
120 <version>2.3.1</version>
121 <executions>
122 <execution>
123 <id>install-file-id</id>
124 <phase>install</phase>
125 <goals>
126 <goal>install-file</goal>
127 </goals>
128 <configuration>
129 <file>${basedir}/src/main/resources/swagger.json</file>
130 <groupId>${project.groupId}</groupId>
131 <artifactId>${project.artifactId}-swagger-schema</artifactId>
132 <version>${project.version}</version>
133 <packaging>json</packaging>
134 </configuration>
135 </execution>
136 </executions>
137 </plugin>
138 </plugins>
139 </build>
140 </profile>
141 <profile>
142 <id>generate-sdk</id>
143 <activation>
144 <file>
145 <exists>${swagger-json}</exists>
146 </file>
147 <property>
148 <name>swagger-sdk.generate-java-sdk</name>
149 </property>
150 </activation>
151 <build>
152 <plugins>
153 <plugin>
154 <groupId>org.apache.maven.plugins</groupId>
155 <artifactId>maven-antrun-plugin</artifactId>
156 <version>1.8</version>
157 <executions>
158 <execution>
159 <phase>initialize</phase>
160 <id>ant-create-script</id>
161 <configuration>
162 <exportAntProperties>true</exportAntProperties>
163 <tasks>
164
165 <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath" />
166 <condition property="is_windows" value="true">
167 <os family="windows"/>
168 </condition>
169 <condition property="isLinux" value="true">
170 <os family="unix" />
171 </condition>
172 <if>
173 <equals arg1="${is_windows}" arg2="true" />
174 <then>
175 <property name="swagger.sdk.script.file" value="generated-source-script.bat"/>
176 <echo file="${project.build.directory}${file.separator}generated-source-script.bat"
177 append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}" />
178 <echo file="${project.build.directory}${file.separator}generated-source-script.bat"
179 append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}" />
180 </then>
181 <else>
182 <property name="swagger.sdk.script.file" value="generated-source-script.sh"/>
183 <echo file="${project.build.directory}${file.separator}generated-source-script.sh"
184 append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}" />
185 <echo file="${project.build.directory}${file.separator}generated-source-script.sh"
186 append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}" />
187 <chmod file="${project.build.directory}${file.separator}generated-source-script.sh" perm="755"/>
188 </else>
189 </if>
190 </tasks>
191 </configuration>
192 <goals>
193 <goal>run</goal>
194 </goals>
195 </execution>
196 </executions>
197 <dependencies>
198 <dependency>
199 <groupId>ant-contrib</groupId>
200 <artifactId>ant-contrib</artifactId>
201 <version>1.0b3</version>
202 <exclusions>
203 <exclusion>
204 <artifactId>ant</artifactId>
205 <groupId>ant</groupId>
206 </exclusion>
207 </exclusions>
208 </dependency>
209 </dependencies>
210 </plugin>
211 <plugin>
212 <groupId>io.swagger</groupId>
213 <artifactId>swagger-codegen-maven-plugin</artifactId>
214 <version>2.2.1</version>
215 <executions>
216 <execution>
217 <goals>
218 <goal>generate</goal>
219 </goals>
220 <configuration>
221 <inputSpec>${basedir}/src/main/resources/swagger.json</inputSpec>
222 <output>${project.build.directory}/generated-sources</output>
223 <language>java</language>
224 <configOptions>
225 <dateLibrary>joda</dateLibrary>
226 </configOptions>
227 <library>jersey2</library>
228 <groupId>${project.groupId}</groupId>
229 <artifactId>${project.artifactId}-java-sdk</artifactId>
230 <artifactVersion>${project.version}</artifactVersion>
231 <modelPackage>${project.groupId}.${project.artifactId}.client.model</modelPackage>
232 <apiPackage>${project.groupId}.${project.artifactId}.client.api</apiPackage>
233 <invokerPackage>${project.groupId}.${project.artifactId}.client.invoker</invokerPackage>
234 </configuration>
235 </execution>
236 </executions>
237 </plugin>
238 <plugin>
239 <artifactId>exec-maven-plugin</artifactId>
240 <groupId>org.codehaus.mojo</groupId>
241 <version>1.5.0</version>
242 <executions>
243 <execution>
244 <id>swagger-generate-sources</id>
245 <phase>generate-sources</phase>
246 <goals>
247 <goal>exec</goal>
248 </goals>
249 <configuration>
250 <executable>${project.build.directory}${file.separator}${swagger.sdk.script.file}</executable>
251 </configuration>
252 </execution>
253 </executions>
254 </plugin>
255 <plugin>
256 <groupId>org.apache.maven.plugins</groupId>
257 <artifactId>maven-clean-plugin</artifactId>
258 <version>3.0.0</version>
259 <executions>
260 <execution>
261 <id>clean-generated-files</id>
262 <phase>generate-sources</phase>
263 <goals>
264 <goal>clean</goal>
265 </goals>
266 <configuration>
267 <filesets>
268 <fileset>
269 <directory>${project.build.directory}/generated-sources</directory>
270 </fileset>
271 </filesets>
272 </configuration>
273 </execution>
274 </executions>
275 </plugin>
276 </plugins>
277 </build>
278 <dependencies>
279 <dependency>
280 <groupId>org.onap.msb.swagger-sdk</groupId>
281 <artifactId>swagger-sdk</artifactId>
282 <version>1.0.0-SNAPSHOT</version>
283 </dependency>
284 </dependencies>
285 </profile>
286 </profiles>
287 <distributionManagement>
288 <repository>
289 <id>ecomp-releases</id>
290 <url>${onap.nexus.url}/content/repositories/releases</url>
291 </repository>
292 <snapshotRepository>
293 <id>ecomp-snapshots</id>
294 <url>${onap.nexus.url}/content/repositories/snapshots</url>
295 </snapshotRepository>
296 </distributionManagement>
297 <build>
298 <pluginManagement>
299 <plugins>
300 <!-- plugins from oparent/version -->
301 <plugin>
302 <groupId>org.sonatype.plugins</groupId>
303 <artifactId>nexus-staging-maven-plugin</artifactId>
304 <version>1.6.7</version>
305 <extensions>true</extensions>
306 <configuration>
307 <nexusUrl>${onap.nexus.url}</nexusUrl>
308 <stagingProfileId>176c31dfe190a</stagingProfileId>
309 <serverId>ecomp-staging</serverId>
310 </configuration>
311 </plugin>
312 <plugin>
313 <groupId>org.apache.maven.plugins</groupId>
314 <artifactId>maven-deploy-plugin</artifactId>
315 <!-- This version supports the "deployAtEnd" parameter -->
316 <version>2.8</version>
317 <configuration>
318 <skip/>
319 </configuration>
320 </plugin>
321 <plugin>
322 <groupId>org.apache.maven.plugins</groupId>
323 <artifactId>maven-site-plugin</artifactId>
324 <version>3.6</version>
325 <dependencies>
326 <dependency>
327 <groupId>org.apache.maven.wagon</groupId>
328 <artifactId>wagon-webdav-jackrabbit</artifactId>
329 <version>2.10</version>
330 </dependency>
331 </dependencies>
332 </plugin>
333 <!-- end of plugins from oparent/version -->
334 <plugin>
335 <artifactId>maven-checkstyle-plugin</artifactId>
336 <version>2.17</version>
337 <dependencies>
338 <dependency>
339 <groupId>org.onap.oparent</groupId>
340 <artifactId>checkstyle</artifactId>
341 <version>1.0.0-SNAPSHOT</version>
342 </dependency>
343 </dependencies>
344 <executions>
345 <execution>
346 <id>check-license</id>
347 <goals>
348 <goal>check</goal>
349 </goals>
350 <phase>process-sources</phase>
351 <configuration>
352 <configLocation>onap-checkstyle/check-license.xml</configLocation>
353 <headerLocation>onap-checkstyle/apache-license-2.regexp.txt</headerLocation>
354 <includeResources>false</includeResources>
355 <includeTestSourceDirectory>true</includeTestSourceDirectory>
356 <includeTestResources>false</includeTestResources>
357 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
358 <excludes>
359 </excludes>
360 <failsOnError>false</failsOnError>
361 <consoleOutput>true</consoleOutput>
362 </configuration>
363 </execution>
364 <execution>
365 <id>check-style</id>
366 <goals>
367 <goal>check</goal>
368 </goals>
369 <phase>process-sources</phase>
370 <configuration>
371 <!-- Use Google Java Style Guide:
372 https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
373 with minor changes -->
374 <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
375 <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
376 <sourceDirectory>${project.build.sourceDirectory}/src/main/java</sourceDirectory>
377 <includeResources>true</includeResources>
378 <includeTestSourceDirectory>true</includeTestSourceDirectory>
379 <includeTestResources>true</includeTestResources>
380 <excludes>
381 </excludes>
382 <failsOnError>false</failsOnError>
383 <consoleOutput>true</consoleOutput>
384 </configuration>
385 </execution>
386 </executions>
387 </plugin>
388 <plugin>
389 <groupId>org.jacoco</groupId>
390 <artifactId>jacoco-maven-plugin</artifactId>
391 <version>${jacoco.version}</version>
392 <configuration>
393 <!-- Note: This exclusion list should match <sonar.exclusions>
394 property above -->
395 <excludes>
396 <exclude>**/gen/**</exclude>
397 <exclude>**/generated-sources/**</exclude>
398 <exclude>**/yang-gen/**</exclude>
399 <exclude>**/pax/**</exclude>
400 </excludes>
401 </configuration>
402 <executions>
403 <!--
404 Prepares the property pointing to the JaCoCo runtime agent which
405 is passed as VM argument when Maven the Surefire plugin is executed.
406 -->
407 <execution>
408 <id>pre-unit-test</id>
409 <goals>
410 <goal>prepare-agent</goal>
411 </goals>
412 <configuration>
413 <!-- Sets the path to the file which contains the execution data. -->
414 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
415 <!--
416 Sets the name of the property containing the settings
417 for JaCoCo runtime agent.
418 -->
419 <propertyName>surefireArgLine</propertyName>
420 </configuration>
421 </execution>
422 <!--
423 Ensures that the code coverage report for unit tests is created after
424 unit tests have been run.
425 -->
426 <execution>
427 <id>post-unit-test</id>
428 <phase>test</phase>
429 <goals>
430 <goal>report</goal>
431 </goals>
432 <configuration>
433 <!-- Sets the path to the file which contains the execution data. -->
434 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
435 <!-- Sets the output directory for the code coverage report. -->
436 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
437 </configuration>
438 </execution>
439 <execution>
440 <id>pre-integration-test</id>
441 <phase>pre-integration-test</phase>
442 <goals>
443 <goal>prepare-agent</goal>
444 </goals>
445 <configuration>
446 <!-- Sets the path to the file which contains the execution data. -->
447 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
448 <!--
449 Sets the name of the property containing the settings
450 for JaCoCo runtime agent.
451 -->
452 <propertyName>failsafeArgLine</propertyName>
453 </configuration>
454 </execution>
455 <!--
456 Ensures that the code coverage report for integration tests after
457 integration tests have been run.
458 -->
459 <execution>
460 <id>post-integration-test</id>
461 <phase>post-integration-test</phase>
462 <goals>
463 <goal>report</goal>
464 </goals>
465 <configuration>
466 <!-- Sets the path to the file which contains the execution data. -->
467 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
468 <!-- Sets the output directory for the code coverage report. -->
469 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
470 </configuration>
471 </execution>
472 </executions>
473 </plugin>
474 <plugin>
475 <groupId>org.apache.maven.plugins</groupId>
476 <artifactId>maven-surefire-plugin</artifactId>
477 <version>2.19.1</version>
478 <configuration>
479 <!-- Sets the VM argument line used when unit tests are run. -->
480 <argLine>${surefireArgLine}</argLine>
481 <!-- Excludes integration tests when unit tests are run. -->
482 <excludes>
483 <exclude>**/IT*.java</exclude>
484 </excludes>
485 </configuration>
486 </plugin>
487 <plugin>
488 <groupId>org.apache.maven.plugins</groupId>
489 <artifactId>maven-failsafe-plugin</artifactId>
490 <version>2.19.1</version>
491 <executions>
492 <!--
493 Ensures that both integration-test and verify goals of the Failsafe Maven
494 plugin are executed.
495 -->
496 <execution>
497 <id>integration-tests</id>
498 <goals>
499 <goal>integration-test</goal>
500 <goal>verify</goal>
501 </goals>
502 <configuration>
503 <!-- Sets the VM argument line used when integration tests are run. -->
504 <argLine>${failsafeArgLine}</argLine>
505 </configuration>
506 </execution>
507 </executions>
508 </plugin>
509 <!-- https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin -->
510 <plugin>
511 <groupId>org.sonarsource.scanner.maven</groupId>
512 <artifactId>sonar-maven-plugin</artifactId>
513 <version>3.3.0.603</version>
514 </plugin>
515 </plugins>
516 </pluginManagement>
517 <plugins>
518 <plugin>
519 <artifactId>maven-checkstyle-plugin</artifactId>
520 </plugin>
521 <plugin>
522 <groupId>org.codehaus.mojo</groupId>
523 <artifactId>build-helper-maven-plugin</artifactId>
524 <version>1.12</version>
525 </plugin>
526 <!-- Jacoco / Sonar -->
527 <plugin>
528 <groupId>org.jacoco</groupId>
529 <artifactId>jacoco-maven-plugin</artifactId>
530 </plugin>
531 <plugin>
532 <groupId>org.apache.maven.plugins</groupId>
533 <artifactId>maven-surefire-plugin</artifactId>
534 </plugin>
535 <plugin>
536 <groupId>org.apache.maven.plugins</groupId>
537 <artifactId>maven-failsafe-plugin</artifactId>
538 </plugin>
Dan Timoney7b8674d2017-10-09 20:04:18 -0400539 <plugin>
540 <groupId>org.sonatype.plugins</groupId>
541 <artifactId>nexus-staging-maven-plugin</artifactId>
542 <version>1.6.7</version>
543 <extensions>true</extensions>
544 <configuration>
545 <nexusUrl>${onap.nexus.url}</nexusUrl>
546 <stagingProfileId>176c31dfe190a</stagingProfileId>
547 <serverId>ecomp-staging</serverId>
548 </configuration>
549 </plugin>
Dan Timoneydc0d02e2017-09-01 13:45:40 -0400550 </plugins>
551 </build>
552</project>