1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 2016-2017 Huawei Technologies Co., Ltd.
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
9 http://www.apache.org/licenses/LICENSE-2.0
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.
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>
20 <groupId>org.onap.oparent</groupId>
21 <artifactId>version</artifactId>
22 <version>1.0.0-SNAPSHOT</version>
23 <relativePath>..</relativePath>
25 <artifactId>oparent</artifactId>
26 <name>oparent/oparent</name>
27 <packaging>pom</packaging>
29 <connection>scm:git:ssh://git.onap.org:29418/oparent.git</connection>
30 <developerConnection>scm:git:ssh://git.onap.org:29418/oparent.git</developerConnection>
32 <url>https://wiki.onap.org/display/DW/Integration+Project</url>
35 <jacoco.version>0.7.7.201606060606</jacoco.version>
36 <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
37 <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
38 <!-- Default Sonar configuration -->
39 <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
40 <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
41 <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
42 <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
43 <!-- If following file exist, auto-generation of swagger.json will be done -->
44 <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties>
45 <!-- If following file exist, auto-generation of sdk will be done -->
46 <swagger-json>${basedir}/src/main/resources/swagger.json</swagger-json>
51 <name>Maven 2 repository 2</name>
52 <url>http://repo2.maven.org/maven2/</url>
55 <id>ecomp-releases</id>
56 <name>ONAP Release Repository</name>
57 <url>https://nexus.onap.org/content/repositories/releases/</url>
60 <id>ecomp-snapshots</id>
61 <name>ONAP Snapshot Repository</name>
62 <url>https://nexus.onap.org/content/repositories/snapshots/</url>
64 <enabled>true</enabled>
67 <enabled>false</enabled>
73 <!-- Needed to download the checkstyle artifact
74 using the repository section of this pom.
75 The checkstyle plugin below use it as dependency,
76 but maven does not want to use the repositories
77 to download the plugin dependency.
79 <groupId>org.onap.oparent</groupId>
80 <artifactId>checkstyle</artifactId>
81 <version>1.0.0-SNAPSHOT</version>
86 <id>generate-json</id>
89 <exists>${swagger-properties}</exists>
92 <name>swagger-sdk.generate-json</name>
98 <groupId>org.codehaus.mojo</groupId>
99 <artifactId>properties-maven-plugin</artifactId>
100 <version>1.0.0</version>
103 <phase>initialize</phase>
105 <goal>read-project-properties</goal>
109 <file>${basedir}/src/main/resources/swagger.properties</file>
116 <groupId>com.github.kongchen</groupId>
117 <artifactId>swagger-maven-plugin</artifactId>
118 <version>3.1.4</version>
122 <locations>${api-rest-package}</locations>
123 <schemes>http,https</schemes>
124 <host>${api-host-ip}:${api-host-port}</host>
125 <basePath>${api-base-path}</basePath>
127 <title>${api-title}</title>
128 <version>${api-version}</version>
129 <description>${api-description}</description>
131 <name>${api-license}</name>
134 <swaggerDirectory>${basedir}/src/main/resources</swaggerDirectory>
140 <phase>compile</phase>
142 <goal>generate</goal>
148 <groupId>org.apache.maven.plugins</groupId>
149 <artifactId>maven-install-plugin</artifactId>
150 <version>2.3.1</version>
153 <id>install-file-id</id>
154 <phase>install</phase>
156 <goal>install-file</goal>
159 <file>${basedir}/src/main/resources/swagger.json</file>
160 <groupId>${project.groupId}</groupId>
161 <artifactId>${project.artifactId}-swagger-schema</artifactId>
162 <version>${project.version}</version>
163 <packaging>json</packaging>
172 <id>generate-sdk</id>
175 <exists>${swagger-json}</exists>
178 <name>swagger-sdk.generate-java-sdk</name>
184 <groupId>org.apache.maven.plugins</groupId>
185 <artifactId>maven-antrun-plugin</artifactId>
186 <version>1.8</version>
189 <phase>initialize</phase>
190 <id>ant-create-script</id>
192 <exportAntProperties>true</exportAntProperties>
194 <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath"/>
195 <condition property="is_windows" value="true">
196 <os family="windows"/>
198 <condition property="isLinux" value="true">
202 <equals arg1="${is_windows}" arg2="true"/>
204 <property name="swagger.sdk.script.file" value="generated-source-script.bat"/>
205 <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
206 <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
209 <property name="swagger.sdk.script.file" value="generated-source-script.sh"/>
210 <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
211 <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
212 <chmod file="${project.build.directory}${file.separator}generated-source-script.sh" perm="755"/>
224 <groupId>ant-contrib</groupId>
225 <artifactId>ant-contrib</artifactId>
226 <version>1.0b3</version>
229 <artifactId>ant</artifactId>
230 <groupId>ant</groupId>
237 <groupId>io.swagger</groupId>
238 <artifactId>swagger-codegen-maven-plugin</artifactId>
239 <version>2.2.1</version>
243 <goal>generate</goal>
246 <inputSpec>${basedir}/src/main/resources/swagger.json</inputSpec>
247 <output>${project.build.directory}/generated-sources</output>
248 <language>java</language>
250 <dateLibrary>joda</dateLibrary>
252 <library>jersey2</library>
253 <groupId>${project.groupId}</groupId>
254 <artifactId>${project.artifactId}-java-sdk</artifactId>
255 <artifactVersion>${project.version}</artifactVersion>
256 <modelPackage>${project.groupId}.${project.artifactId}.client.model</modelPackage>
257 <apiPackage>${project.groupId}.${project.artifactId}.client.api</apiPackage>
258 <invokerPackage>${project.groupId}.${project.artifactId}.client.invoker</invokerPackage>
264 <artifactId>exec-maven-plugin</artifactId>
265 <groupId>org.codehaus.mojo</groupId>
266 <version>1.5.0</version>
269 <id>swagger-generate-sources</id>
270 <phase>generate-sources</phase>
275 <executable>${project.build.directory}${file.separator}${swagger.sdk.script.file}</executable>
281 <groupId>org.apache.maven.plugins</groupId>
282 <artifactId>maven-clean-plugin</artifactId>
283 <version>3.0.0</version>
286 <id>clean-generated-files</id>
287 <phase>generate-sources</phase>
294 <directory>${project.build.directory}/generated-sources</directory>
305 <groupId>org.onap.msb.swagger-sdk</groupId>
306 <artifactId>swagger-sdk</artifactId>
307 <version>1.0.0-SNAPSHOT</version>
316 <artifactId>maven-checkstyle-plugin</artifactId>
317 <version>2.17</version>
320 <groupId>org.onap.oparent</groupId>
321 <artifactId>checkstyle</artifactId>
322 <version>1.0.0-SNAPSHOT</version>
327 <id>check-license</id>
331 <phase>process-sources</phase>
333 <configLocation>onap-checkstyle/check-license.xml</configLocation>
334 <includeResources>false</includeResources>
335 <includeTestSourceDirectory>true</includeTestSourceDirectory>
336 <includeTestResources>false</includeTestResources>
337 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
340 <consoleOutput>true</consoleOutput>
341 <failsOnViolation>false</failsOnViolation>
349 <phase>process-sources</phase>
351 <!-- Use Google Java Style Guide:
352 https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
353 with minor changes -->
354 <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
355 <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
356 <sourceDirectory>${project.build.sourceDirectory}/src/main/java</sourceDirectory>
357 <includeResources>true</includeResources>
358 <includeTestSourceDirectory>true</includeTestSourceDirectory>
359 <includeTestResources>true</includeTestResources>
362 <consoleOutput>true</consoleOutput>
363 <failsOnViolation>false</failsOnViolation>
369 <groupId>org.jacoco</groupId>
370 <artifactId>jacoco-maven-plugin</artifactId>
371 <version>${jacoco.version}</version>
373 <!-- Note: This exclusion list should match <sonar.exclusions>
376 <exclude>**/gen/**</exclude>
377 <exclude>**/generated-sources/**</exclude>
378 <exclude>**/yang-gen/**</exclude>
379 <exclude>**/pax/**</exclude>
384 Prepares the property pointing to the JaCoCo runtime agent which
385 is passed as VM argument when Maven the Surefire plugin is executed.
388 <id>pre-unit-test</id>
390 <goal>prepare-agent</goal>
393 <!-- Sets the path to the file which contains the execution data. -->
394 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
396 Sets the name of the property containing the settings
397 for JaCoCo runtime agent.
399 <propertyName>surefireArgLine</propertyName>
403 Ensures that the code coverage report for unit tests is created after
404 unit tests have been run.
407 <id>post-unit-test</id>
413 <!-- Sets the path to the file which contains the execution data. -->
414 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
415 <!-- Sets the output directory for the code coverage report. -->
416 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
420 <id>pre-integration-test</id>
421 <phase>pre-integration-test</phase>
423 <goal>prepare-agent</goal>
426 <!-- Sets the path to the file which contains the execution data. -->
427 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
429 Sets the name of the property containing the settings
430 for JaCoCo runtime agent.
432 <propertyName>failsafeArgLine</propertyName>
436 Ensures that the code coverage report for integration tests after
437 integration tests have been run.
440 <id>post-integration-test</id>
441 <phase>post-integration-test</phase>
446 <!-- Sets the path to the file which contains the execution data. -->
447 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
448 <!-- Sets the output directory for the code coverage report. -->
449 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
455 <groupId>org.apache.maven.plugins</groupId>
456 <artifactId>maven-surefire-plugin</artifactId>
457 <version>2.19.1</version>
459 <!-- Sets the VM argument line used when unit tests are run. -->
460 <argLine>${surefireArgLine}</argLine>
461 <!-- Excludes integration tests when unit tests are run. -->
463 <exclude>**/IT*.java</exclude>
468 <groupId>org.apache.maven.plugins</groupId>
469 <artifactId>maven-failsafe-plugin</artifactId>
470 <version>2.19.1</version>
473 Ensures that both integration-test and verify goals of the Failsafe Maven
477 <id>integration-tests</id>
479 <goal>integration-test</goal>
483 <!-- Sets the VM argument line used when integration tests are run. -->
484 <argLine>${failsafeArgLine}</argLine>
489 <!-- https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin -->
491 <groupId>org.sonarsource.scanner.maven</groupId>
492 <artifactId>sonar-maven-plugin</artifactId>
493 <version>3.3.0.603</version>
499 <artifactId>maven-checkstyle-plugin</artifactId>
502 <groupId>org.codehaus.mojo</groupId>
503 <artifactId>build-helper-maven-plugin</artifactId>
504 <version>1.12</version>
506 <!-- Jacoco / Sonar -->
508 <groupId>org.jacoco</groupId>
509 <artifactId>jacoco-maven-plugin</artifactId>
512 <groupId>org.apache.maven.plugins</groupId>
513 <artifactId>maven-surefire-plugin</artifactId>
516 <groupId>org.apache.maven.plugins</groupId>
517 <artifactId>maven-failsafe-plugin</artifactId>