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.2.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>
74 <name>Maven 2 repository 2</name>
75 <url>http://repo2.maven.org/maven2/</url>
78 <id>ecomp-releases</id>
79 <name>ONAP Release Repository</name>
80 <url>https://nexus.onap.org/content/repositories/releases/</url>
83 <id>ecomp-snapshots</id>
84 <name>ONAP Snapshot Repository</name>
85 <url>https://nexus.onap.org/content/repositories/snapshots/</url>
87 <enabled>true</enabled>
90 <enabled>false</enabled>
96 <id>generate-json</id>
99 <exists>${swagger-properties}</exists>
102 <name>swagger-sdk.generate-json</name>
108 <groupId>org.codehaus.mojo</groupId>
109 <artifactId>properties-maven-plugin</artifactId>
110 <version>1.0.0</version>
113 <phase>initialize</phase>
115 <goal>read-project-properties</goal>
119 <file>${basedir}/src/main/resources/swagger.properties</file>
126 <groupId>com.github.kongchen</groupId>
127 <artifactId>swagger-maven-plugin</artifactId>
128 <version>3.1.4</version>
132 <locations>${api-rest-package}</locations>
133 <schemes>http,https</schemes>
134 <host>${api-host-ip}:${api-host-port}</host>
135 <basePath>${api-base-path}</basePath>
137 <title>${api-title}</title>
138 <version>${api-version}</version>
139 <description>${api-description}</description>
141 <name>${api-license}</name>
144 <swaggerDirectory>${basedir}/src/main/resources</swaggerDirectory>
150 <phase>compile</phase>
152 <goal>generate</goal>
158 <groupId>org.apache.maven.plugins</groupId>
159 <artifactId>maven-install-plugin</artifactId>
160 <version>2.3.1</version>
163 <id>install-file-id</id>
164 <phase>install</phase>
166 <goal>install-file</goal>
169 <file>${basedir}/src/main/resources/swagger.json</file>
170 <groupId>${project.groupId}</groupId>
171 <artifactId>${project.artifactId}-swagger-schema</artifactId>
172 <version>${project.version}</version>
173 <packaging>json</packaging>
182 <id>generate-sdk</id>
185 <exists>${swagger-json}</exists>
188 <name>swagger-sdk.generate-java-sdk</name>
194 <groupId>org.apache.maven.plugins</groupId>
195 <artifactId>maven-antrun-plugin</artifactId>
196 <version>1.8</version>
199 <phase>initialize</phase>
200 <id>ant-create-script</id>
202 <exportAntProperties>true</exportAntProperties>
204 <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath"/>
205 <condition property="is_windows" value="true">
206 <os family="windows"/>
208 <condition property="isLinux" value="true">
212 <equals arg1="${is_windows}" arg2="true"/>
214 <property name="swagger.sdk.script.file" value="generated-source-script.bat"/>
215 <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
216 <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
219 <property name="swagger.sdk.script.file" value="generated-source-script.sh"/>
220 <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
221 <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
222 <chmod file="${project.build.directory}${file.separator}generated-source-script.sh" perm="755"/>
234 <groupId>ant-contrib</groupId>
235 <artifactId>ant-contrib</artifactId>
236 <version>1.0b3</version>
239 <artifactId>ant</artifactId>
240 <groupId>ant</groupId>
247 <groupId>io.swagger</groupId>
248 <artifactId>swagger-codegen-maven-plugin</artifactId>
249 <version>2.2.1</version>
253 <goal>generate</goal>
256 <inputSpec>${basedir}/src/main/resources/swagger.json</inputSpec>
257 <output>${project.build.directory}/generated-sources</output>
258 <language>java</language>
260 <dateLibrary>joda</dateLibrary>
262 <library>jersey2</library>
263 <groupId>${project.groupId}</groupId>
264 <artifactId>${project.artifactId}-java-sdk</artifactId>
265 <artifactVersion>${project.version}</artifactVersion>
266 <modelPackage>${project.groupId}.${project.artifactId}.client.model</modelPackage>
267 <apiPackage>${project.groupId}.${project.artifactId}.client.api</apiPackage>
268 <invokerPackage>${project.groupId}.${project.artifactId}.client.invoker</invokerPackage>
274 <artifactId>exec-maven-plugin</artifactId>
275 <groupId>org.codehaus.mojo</groupId>
276 <version>1.5.0</version>
279 <id>swagger-generate-sources</id>
280 <phase>generate-sources</phase>
285 <executable>${project.build.directory}${file.separator}${swagger.sdk.script.file}</executable>
291 <groupId>org.apache.maven.plugins</groupId>
292 <artifactId>maven-clean-plugin</artifactId>
293 <version>3.0.0</version>
296 <id>clean-generated-files</id>
297 <phase>generate-sources</phase>
304 <directory>${project.build.directory}/generated-sources</directory>
315 <groupId>org.onap.msb.swagger-sdk</groupId>
316 <artifactId>swagger-sdk</artifactId>
317 <version>1.0.0</version>
322 <dependencyManagement>
325 <groupId>org.onap.oparent</groupId>
326 <artifactId>dependencies</artifactId>
327 <version>1.2.0-SNAPSHOT</version>
329 <scope>import</scope>
332 </dependencyManagement>
337 <groupId>org.jacoco</groupId>
338 <artifactId>jacoco-maven-plugin</artifactId>
339 <version>${jacoco.version}</version>
341 <!-- Note: This exclusion list should match <sonar.exclusions>
344 <exclude>**/gen/**</exclude>
345 <exclude>**/generated-sources/**</exclude>
346 <exclude>**/yang-gen/**</exclude>
347 <exclude>**/pax/**</exclude>
352 Prepares the property pointing to the JaCoCo runtime agent which
353 is passed as VM argument when Maven the Surefire plugin is executed.
356 <id>pre-unit-test</id>
358 <goal>prepare-agent</goal>
361 <!-- Sets the path to the file which contains the execution data. -->
362 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
364 Sets the name of the property containing the settings
365 for JaCoCo runtime agent.
367 <propertyName>surefireArgLine</propertyName>
371 Ensures that the code coverage report for unit tests is created after
372 unit tests have been run.
375 <id>post-unit-test</id>
381 <!-- Sets the path to the file which contains the execution data. -->
382 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
383 <!-- Sets the output directory for the code coverage report. -->
384 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
388 <id>pre-integration-test</id>
389 <phase>pre-integration-test</phase>
391 <goal>prepare-agent</goal>
394 <!-- Sets the path to the file which contains the execution data. -->
395 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
397 Sets the name of the property containing the settings
398 for JaCoCo runtime agent.
400 <propertyName>failsafeArgLine</propertyName>
404 Ensures that the code coverage report for integration tests after
405 integration tests have been run.
408 <id>post-integration-test</id>
409 <phase>post-integration-test</phase>
414 <!-- Sets the path to the file which contains the execution data. -->
415 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
416 <!-- Sets the output directory for the code coverage report. -->
417 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
423 <groupId>org.apache.maven.plugins</groupId>
424 <artifactId>maven-surefire-plugin</artifactId>
425 <version>2.22.0</version>
427 <!-- Sets the VM argument line used when unit tests are run. -->
428 <argLine>${surefireArgLine}</argLine>
429 <!-- Excludes integration tests when unit tests are run. -->
431 <exclude>**/IT*.java</exclude>
436 <groupId>org.apache.maven.plugins</groupId>
437 <artifactId>maven-failsafe-plugin</artifactId>
438 <version>2.22.0</version>
441 Ensures that both integration-test and verify goals of the Failsafe Maven
445 <id>integration-tests</id>
447 <goal>integration-test</goal>
451 <!-- Sets the VM argument line used when integration tests are run. -->
452 <argLine>${failsafeArgLine}</argLine>
457 <!-- https://mvnrepository.com/artifact/org.sonarsource.scanner.maven/sonar-maven-plugin -->
459 <groupId>org.sonarsource.scanner.maven</groupId>
460 <artifactId>sonar-maven-plugin</artifactId>
461 <version>3.2</version>
467 <artifactId>maven-checkstyle-plugin</artifactId>
468 <version>2.17</version>
471 <groupId>org.onap.oparent</groupId>
472 <artifactId>checkstyle</artifactId>
473 <version>1.2.0-SNAPSHOT</version>
478 <id>onap-license</id>
482 <phase>process-sources</phase>
484 <configLocation>onap-checkstyle/check-license.xml</configLocation>
485 <includeResources>false</includeResources>
486 <includeTestSourceDirectory>true</includeTestSourceDirectory>
487 <includeTestResources>false</includeTestResources>
488 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
491 <consoleOutput>true</consoleOutput>
492 <failsOnViolation>false</failsOnViolation>
496 <id>onap-java-style</id>
500 <phase>process-sources</phase>
502 <!-- Use Google Java Style Guide:
503 https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
504 with minor changes -->
505 <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
506 <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
507 <sourceDirectory>${project.build.sourceDirectory}/src/main/java</sourceDirectory>
508 <includeResources>true</includeResources>
509 <includeTestSourceDirectory>true</includeTestSourceDirectory>
510 <includeTestResources>true</includeTestResources>
513 <consoleOutput>true</consoleOutput>
514 <failsOnViolation>false</failsOnViolation>
520 <groupId>org.codehaus.mojo</groupId>
521 <artifactId>build-helper-maven-plugin</artifactId>
522 <version>1.12</version>
524 <!-- Jacoco / Sonar -->
526 <groupId>org.jacoco</groupId>
527 <artifactId>jacoco-maven-plugin</artifactId>
530 <groupId>org.apache.maven.plugins</groupId>
531 <artifactId>maven-surefire-plugin</artifactId>
534 <groupId>org.apache.maven.plugins</groupId>
535 <artifactId>maven-failsafe-plugin</artifactId>