diff options
author | Dan Timoney <dtimoney@att.com> | 2020-01-17 09:54:02 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2020-01-20 01:34:18 +0000 |
commit | 621888e708275d68f45946afbbdc1c7e4db64dde (patch) | |
tree | 250ee1c5025b53990e298e20fabeaefa9c97af49 | |
parent | 9209a391b8e0d2257374bd2ebb02f3254f2f3dec (diff) |
Update sonar config for sonarcloud
Update sonar and jacoco config for latest sonar scan version, compatible
with sonarcloud
Change-Id: I4660a685742675f0b7fd6c762b631a66ca4a244c
Issue-ID: CCSDK-2029
Signed-off-by: Dan Timoney <dtimoney@att.com>
-rw-r--r-- | odlparent/binding-parent/pom.xml | 210 | ||||
-rw-r--r-- | odlparent/bundle-parent/pom.xml | 210 | ||||
-rw-r--r-- | odlparent/feature-repo-parent/pom.xml | 210 | ||||
-rw-r--r-- | odlparent/karaf4-parent/pom.xml | 210 | ||||
-rw-r--r-- | odlparent/mdsal-it-parent/pom.xml | 210 | ||||
-rw-r--r-- | odlparent/odlparent-lite/pom.xml | 210 | ||||
-rw-r--r-- | odlparent/odlparent/pom.xml | 210 | ||||
-rwxr-xr-x | odlparent/setup/src/main/resources/pom-template.xml | 210 | ||||
-rw-r--r-- | odlparent/single-feature-parent/pom.xml | 210 | ||||
-rwxr-xr-x | springboot/springboot1/pom.xml | 196 | ||||
-rwxr-xr-x | springboot/springboot2/pom.xml | 197 |
11 files changed, 1327 insertions, 956 deletions
diff --git a/odlparent/binding-parent/pom.xml b/odlparent/binding-parent/pom.xml index 8c1e434c..d269340f 100644 --- a/odlparent/binding-parent/pom.xml +++ b/odlparent/binding-parent/pom.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/odlparent/bundle-parent/pom.xml b/odlparent/bundle-parent/pom.xml index d1dc5738..b5a7d79c 100644 --- a/odlparent/bundle-parent/pom.xml +++ b/odlparent/bundle-parent/pom.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/odlparent/feature-repo-parent/pom.xml b/odlparent/feature-repo-parent/pom.xml index 1ce404e6..95876261 100644 --- a/odlparent/feature-repo-parent/pom.xml +++ b/odlparent/feature-repo-parent/pom.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/odlparent/karaf4-parent/pom.xml b/odlparent/karaf4-parent/pom.xml index 164e3b12..7c621dad 100644 --- a/odlparent/karaf4-parent/pom.xml +++ b/odlparent/karaf4-parent/pom.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/odlparent/mdsal-it-parent/pom.xml b/odlparent/mdsal-it-parent/pom.xml index 40420744..e13b1052 100644 --- a/odlparent/mdsal-it-parent/pom.xml +++ b/odlparent/mdsal-it-parent/pom.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/odlparent/odlparent-lite/pom.xml b/odlparent/odlparent-lite/pom.xml index b3f9a87c..8b3e6be3 100644 --- a/odlparent/odlparent-lite/pom.xml +++ b/odlparent/odlparent-lite/pom.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/odlparent/odlparent/pom.xml b/odlparent/odlparent/pom.xml index 651874d8..3bb179bb 100644 --- a/odlparent/odlparent/pom.xml +++ b/odlparent/odlparent/pom.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/odlparent/setup/src/main/resources/pom-template.xml b/odlparent/setup/src/main/resources/pom-template.xml index d663031b..25b1e816 100755 --- a/odlparent/setup/src/main/resources/pom-template.xml +++ b/odlparent/setup/src/main/resources/pom-template.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>\${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,\${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/\${project.groupId}/\${project.artifactId}/\${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>\${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>\${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>\${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>\${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>\${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>\${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>\${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>\${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>\${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>\${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>\${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>\${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>\${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>\${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>\${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>\${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>\${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>\${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/odlparent/single-feature-parent/pom.xml b/odlparent/single-feature-parent/pom.xml index 809676c7..5ee8a9da 100644 --- a/odlparent/single-feature-parent/pom.xml +++ b/odlparent/single-feature-parent/pom.xml @@ -41,6 +41,18 @@ <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> + <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -49,13 +61,9 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -87,10 +95,7 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> + <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -468,88 +473,13 @@ <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> - <version>3.6.0.1398</version> + <version>${sonar.scanner.version}</version> </plugin> <!-- end of plugins from ONAP version (parent of oparent) --> <!-- Plugins from ONAP oparent --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -720,6 +650,99 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -759,6 +782,19 @@ <additionalparam>-Xdoclint:none</additionalparam> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <reportSets> + <reportSet> + <reports> + <!-- select non-aggregate reports --> + <report>report</report> + </reports> + </reportSet> + </reportSets> + </plugin> </plugins> </reporting> diff --git a/springboot/springboot1/pom.xml b/springboot/springboot1/pom.xml index 63c1c50f..a090a663 100755 --- a/springboot/springboot1/pom.xml +++ b/springboot/springboot1/pom.xml @@ -37,6 +37,17 @@ </distributionManagement> <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> @@ -46,13 +57,7 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -79,10 +84,6 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> @@ -391,82 +392,7 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -596,6 +522,104 @@ </pluginManagement> <plugins> <!-- Plugins from ONAP oparent --> + <!-- Jacoco / Sonar --> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> + </plugin> <plugin> <artifactId>maven-checkstyle-plugin</artifactId> </plugin> diff --git a/springboot/springboot2/pom.xml b/springboot/springboot2/pom.xml index c1034b94..e18de4ec 100755 --- a/springboot/springboot2/pom.xml +++ b/springboot/springboot2/pom.xml @@ -37,6 +37,17 @@ </distributionManagement> <properties> + <!-- Sonar properties --> + <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> + <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <!-- Default Sonar configuration --> + <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml,${project.reporting.outputDirectory}/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths> + <!-- Note: This list should match jacoco-maven-plugin's exclusion list below --> + <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> + + <!-- Jacoco properties --> + <jacoco.version>0.8.5</jacoco.version> <!-- properties from oparent --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> @@ -45,13 +56,7 @@ <onap.nexus.url>https://nexus.onap.org</onap.nexus.url> <!-- sitePath may be overridden in the inheriting POM if desired --> <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath> - <jacoco.version>0.7.7.201606060606</jacoco.version> - <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version> - <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> - <!-- Note: This list should match jacoco-maven-plugin's exclusion list - below --> - <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions> <!-- If following file exist, auto-generation of swagger.json will be done --> <swagger-properties>${basedir}/src/main/resources/swagger.properties</swagger-properties> <!-- If following file exist, auto-generation of sdk will be done --> @@ -78,11 +83,6 @@ <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath> <checkstyle.skip>true</checkstyle.skip> - <sonar.language>java</sonar.language> - <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath> - <sonar.projectVersion>${project.version}</sonar.projectVersion> - <!-- CCSDK component versions --> <ccsdk.cds.version>0.7.0-SNAPSHOT</ccsdk.cds.version> <ccsdk.sli.core.version>0.7.0-SNAPSHOT</ccsdk.sli.core.version> @@ -422,82 +422,7 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <!-- Note: This exclusion list should match <sonar.exclusions> property - above --> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - <executions> - <!-- Prepares the property pointing to the JaCoCo runtime agent which - is passed as VM argument when Maven the Surefire plugin is executed. --> - <execution> - <id>pre-unit-test</id> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>surefireArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for unit tests is created - after unit tests have been run. --> - <execution> - <id>post-unit-test</id> - <phase>test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> - </configuration> - </execution> - <execution> - <id>pre-integration-test</id> - <phase>pre-integration-test</phase> - <goals> - <goal>prepare-agent</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> - <!-- Sets the name of the property containing the settings for JaCoCo - runtime agent. --> - <propertyName>failsafeArgLine</propertyName> - </configuration> - </execution> - <!-- Ensures that the code coverage report for integration tests after - integration tests have been run. --> - <execution> - <id>post-integration-test</id> - <phase>post-integration-test</phase> - <goals> - <goal>report</goal> - </goals> - <configuration> - <!-- Sets the path to the file which contains the execution data. --> - <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> - <!-- Sets the output directory for the code coverage report. --> - <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -627,6 +552,104 @@ </pluginManagement> <plugins> <!-- Plugins from ONAP oparent --> + <!-- Jacoco / Sonar --> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + <executions> + <execution> + <id>pre-unit-test</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>surefireArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for unit tests is created + after unit tests have been run. --> + <execution> + <id>post-unit-test</id> + <phase>test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory> + </configuration> + </execution> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile> + <!-- Sets the name of the property containing the settings for JaCoCo + runtime agent. --> + <propertyName>failsafeArgLine</propertyName> + </configuration> + </execution> + <!-- Ensures that the code coverage report for integration tests after + integration tests have been run. --> + <execution> + <id>post-integration-test</id> + <phase>post-integration-test</phase> + <goals> + <goal>report</goal> + </goals> + <configuration> + <!-- Sets the path to the file which contains the execution data. --> + <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile> + <!-- Sets the output directory for the code coverage report. --> + <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory> + </configuration> + </execution> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + <execution> + <id>default-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <rules> + <rule> + <element>PACKAGE</element> + <limits> + <limit> + <counter>COMPLEXITY</counter> + <value>COVEREDRATIO</value> + <minimum>0.0</minimum> + </limit> + </limits> + </rule> + </rules> + </configuration> + </execution> + </executions> + </plugin> <plugin> <artifactId>maven-checkstyle-plugin</artifactId> </plugin> |