1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 2016-2017 Huawei Technologies Co., Ltd.
4 Modifications copyright (C) 2019 AT&T Intellectual Property
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
18 <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">
19 <modelVersion>4.0.0</modelVersion>
21 <groupId>org.onap.oparent</groupId>
22 <artifactId>version</artifactId>
23 <version>3.0.0-SNAPSHOT</version>
24 <relativePath>..</relativePath>
26 <artifactId>oparent</artifactId>
27 <name>oparent/oparent</name>
28 <packaging>pom</packaging>
30 <connection>scm:git:ssh://git.onap.org:29418/oparent.git</connection>
31 <developerConnection>scm:git:ssh://git.onap.org:29418/oparent.git</developerConnection>
33 <url>https://wiki.onap.org/display/DW/Integration+Project</url>
36 <jacoco.version>0.8.2</jacoco.version>
37 <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
38 <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
39 <!-- Default Sonar configuration -->
40 <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
41 <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
42 <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
43 <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
44 <!-- If following file exist, auto-generation of swagger.json will be done -->
45 <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties>
46 <!-- If following file exist, auto-generation of sdk will be done -->
47 <swagger-json>${basedir}/src/main/resources/swagger.json</swagger-json>
51 <id>generate-json</id>
54 <exists>${swagger-properties}</exists>
57 <name>swagger-sdk.generate-json</name>
63 <groupId>org.codehaus.mojo</groupId>
64 <artifactId>properties-maven-plugin</artifactId>
65 <version>1.0.0</version>
68 <phase>initialize</phase>
70 <goal>read-project-properties</goal>
74 <file>${basedir}/src/main/resources/swagger.properties</file>
81 <groupId>com.github.kongchen</groupId>
82 <artifactId>swagger-maven-plugin</artifactId>
83 <version>3.1.4</version>
87 <locations>${api-rest-package}</locations>
88 <schemes>http,https</schemes>
89 <host>${api-host-ip}:${api-host-port}</host>
90 <basePath>${api-base-path}</basePath>
92 <title>${api-title}</title>
93 <version>${api-version}</version>
94 <description>${api-description}</description>
96 <name>${api-license}</name>
99 <swaggerDirectory>${basedir}/src/main/resources</swaggerDirectory>
105 <phase>compile</phase>
107 <goal>generate</goal>
113 <groupId>org.apache.maven.plugins</groupId>
114 <artifactId>maven-install-plugin</artifactId>
115 <version>2.3.1</version>
118 <id>install-file-id</id>
119 <phase>install</phase>
121 <goal>install-file</goal>
124 <file>${basedir}/src/main/resources/swagger.json</file>
125 <groupId>${project.groupId}</groupId>
126 <artifactId>${project.artifactId}-swagger-schema</artifactId>
127 <version>${project.version}</version>
128 <packaging>json</packaging>
137 <id>generate-sdk</id>
140 <exists>${swagger-json}</exists>
143 <name>swagger-sdk.generate-java-sdk</name>
149 <groupId>org.apache.maven.plugins</groupId>
150 <artifactId>maven-antrun-plugin</artifactId>
151 <version>1.8</version>
154 <phase>initialize</phase>
155 <id>ant-create-script</id>
157 <exportAntProperties>true</exportAntProperties>
159 <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath"/>
160 <condition property="is_windows" value="true">
161 <os family="windows"/>
163 <condition property="isLinux" value="true">
167 <equals arg1="${is_windows}" arg2="true"/>
169 <property name="swagger.sdk.script.file" value="generated-source-script.bat"/>
170 <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
171 <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
174 <property name="swagger.sdk.script.file" value="generated-source-script.sh"/>
175 <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
176 <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
177 <chmod file="${project.build.directory}${file.separator}generated-source-script.sh" perm="755"/>
189 <groupId>ant-contrib</groupId>
190 <artifactId>ant-contrib</artifactId>
191 <version>1.0b3</version>
194 <artifactId>ant</artifactId>
195 <groupId>ant</groupId>
202 <groupId>io.swagger</groupId>
203 <artifactId>swagger-codegen-maven-plugin</artifactId>
204 <version>2.2.1</version>
208 <goal>generate</goal>
211 <inputSpec>${basedir}/src/main/resources/swagger.json</inputSpec>
212 <output>${project.build.directory}/generated-sources</output>
213 <language>java</language>
215 <dateLibrary>joda</dateLibrary>
217 <library>jersey2</library>
218 <groupId>${project.groupId}</groupId>
219 <artifactId>${project.artifactId}-java-sdk</artifactId>
220 <artifactVersion>${project.version}</artifactVersion>
221 <modelPackage>${project.groupId}.${project.artifactId}.client.model</modelPackage>
222 <apiPackage>${project.groupId}.${project.artifactId}.client.api</apiPackage>
223 <invokerPackage>${project.groupId}.${project.artifactId}.client.invoker</invokerPackage>
229 <artifactId>exec-maven-plugin</artifactId>
230 <groupId>org.codehaus.mojo</groupId>
231 <version>1.5.0</version>
234 <id>swagger-generate-sources</id>
235 <phase>generate-sources</phase>
240 <executable>${project.build.directory}${file.separator}${swagger.sdk.script.file}</executable>
246 <groupId>org.apache.maven.plugins</groupId>
247 <artifactId>maven-clean-plugin</artifactId>
248 <version>3.0.0</version>
251 <id>clean-generated-files</id>
252 <phase>generate-sources</phase>
259 <directory>${project.build.directory}/generated-sources</directory>
270 <groupId>org.onap.msb.swagger-sdk</groupId>
271 <artifactId>swagger-sdk</artifactId>
272 <version>1.0.0</version>
280 <!-- overrides oparent's existing checkstyle to check java 8 code -->
281 <id>checkstyle-jdk8</id>
286 - override the original oparent checkstyle configuration to
287 - use a later version of checkstyle which is jdk8 aware, and
288 - use an updated checkstyle config that conforms to onap style and the later checkstyle format.
290 <artifactId>maven-checkstyle-plugin</artifactId>
291 <version>3.1.0</version>
294 <!-- because google's latest style is not supported by plugin's default version-->
295 <groupId>com.puppycrawl.tools</groupId>
296 <artifactId>checkstyle</artifactId>
297 <version>8.24</version>
302 <id>onap-license</id>
304 <!-- this config not supported by checkstyle any more -->
305 <sourceDirectory combine.self="override"/>
307 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
312 <id>onap-java-style</id>
314 <!-- Use Google Java Style Guide:
315 https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
316 with minor changes -->
317 <configLocation>onap-checkstyle/onap-java-style${maven.compiler.source}.xml</configLocation>
318 <!-- this config not supported by checkstyle any more -->
319 <sourceDirectory combine.self="override"/>
321 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
331 <dependencyManagement>
334 <groupId>org.onap.oparent</groupId>
335 <artifactId>dependencies</artifactId>
336 <version>3.0.0-SNAPSHOT</version>
338 <scope>import</scope>
341 </dependencyManagement>
346 <groupId>org.jacoco</groupId>
347 <artifactId>jacoco-maven-plugin</artifactId>
348 <version>${jacoco.version}</version>
350 <!-- Note: This exclusion list should match <sonar.exclusions>
353 <exclude>**/gen/**</exclude>
354 <exclude>**/generated-sources/**</exclude>
355 <exclude>**/yang-gen/**</exclude>
356 <exclude>**/pax/**</exclude>
361 Prepares the property pointing to the JaCoCo runtime agent which
362 is passed as VM argument when Maven the Surefire plugin is executed.
365 <id>pre-unit-test</id>
367 <goal>prepare-agent</goal>
370 <!-- Sets the path to the file which contains the execution data. -->
371 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
373 Sets the name of the property containing the settings
374 for JaCoCo runtime agent.
376 <propertyName>surefireArgLine</propertyName>
380 Ensures that the code coverage report for unit tests is created after
381 unit tests have been run.
384 <id>post-unit-test</id>
390 <!-- Sets the path to the file which contains the execution data. -->
391 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
392 <!-- Sets the output directory for the code coverage report. -->
393 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
397 <id>pre-integration-test</id>
398 <phase>pre-integration-test</phase>
400 <goal>prepare-agent</goal>
403 <!-- Sets the path to the file which contains the execution data. -->
404 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
406 Sets the name of the property containing the settings
407 for JaCoCo runtime agent.
409 <propertyName>failsafeArgLine</propertyName>
413 Ensures that the code coverage report for integration tests after
414 integration tests have been run.
417 <id>post-integration-test</id>
418 <phase>post-integration-test</phase>
423 <!-- Sets the path to the file which contains the execution data. -->
424 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
425 <!-- Sets the output directory for the code coverage report. -->
426 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
432 <groupId>org.apache.maven.plugins</groupId>
433 <artifactId>maven-surefire-plugin</artifactId>
434 <version>2.22.0</version>
436 <!-- Sets the VM argument line used when unit tests are run. -->
437 <argLine>${surefireArgLine}</argLine>
438 <!-- Excludes integration tests when unit tests are run. -->
440 <exclude>**/IT*.java</exclude>
445 <groupId>org.apache.maven.plugins</groupId>
446 <artifactId>maven-failsafe-plugin</artifactId>
447 <version>2.22.0</version>
450 Ensures that both integration-test and verify goals of the Failsafe Maven
454 <id>integration-tests</id>
456 <goal>integration-test</goal>
460 <!-- Sets the VM argument line used when integration tests are run. -->
461 <argLine>${failsafeArgLine}</argLine>
466 <!-- https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin -->
468 <groupId>org.sonarsource.scanner.maven</groupId>
469 <artifactId>sonar-maven-plugin</artifactId>
470 <version>3.2</version>
476 <artifactId>maven-checkstyle-plugin</artifactId>
477 <version>2.17</version>
480 <groupId>org.onap.oparent</groupId>
481 <artifactId>checkstyle</artifactId>
482 <version>3.0.0-SNAPSHOT</version>
487 <id>onap-license</id>
491 <phase>process-sources</phase>
493 <configLocation>onap-checkstyle/check-license.xml</configLocation>
494 <includeResources>false</includeResources>
495 <includeTestSourceDirectory>true</includeTestSourceDirectory>
496 <includeTestResources>false</includeTestResources>
497 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
500 <consoleOutput>true</consoleOutput>
501 <failsOnViolation>false</failsOnViolation>
505 <id>onap-java-style</id>
509 <phase>process-sources</phase>
511 <!-- Use Google Java Style Guide:
512 https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
513 with minor changes -->
514 <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
515 <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
516 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
517 <includeResources>true</includeResources>
518 <includeTestSourceDirectory>true</includeTestSourceDirectory>
519 <includeTestResources>true</includeTestResources>
522 <consoleOutput>true</consoleOutput>
523 <failsOnViolation>false</failsOnViolation>
529 <groupId>org.codehaus.mojo</groupId>
530 <artifactId>build-helper-maven-plugin</artifactId>
531 <version>1.12</version>
533 <!-- Jacoco / Sonar -->
535 <groupId>org.jacoco</groupId>
536 <artifactId>jacoco-maven-plugin</artifactId>
539 <groupId>org.apache.maven.plugins</groupId>
540 <artifactId>maven-surefire-plugin</artifactId>
543 <groupId>org.apache.maven.plugins</groupId>
544 <artifactId>maven-failsafe-plugin</artifactId>