add jacoco plugin for sonar cloud 97/98197/4
authorTaka Cho <takamune.cho@att.com>
Fri, 8 Nov 2019 18:44:40 +0000 (13:44 -0500)
committerTaka Cho <takamune.cho@att.com>
Fri, 8 Nov 2019 18:59:18 +0000 (13:59 -0500)
in IT-7899, Jess recommends add
plugin for sonar cloud

Issue-ID: APPC-1791
Change-Id: Ia4b73a7e41ac4c1b2c1638e45ab806c054667d42
Signed-off-by: Taka Cho <takamune.cho@att.com>
pom.xml

diff --git a/pom.xml b/pom.xml
index 35d8ff6..a25566b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -123,6 +123,18 @@ limitations under the License.
                     <useStandardDocletOptions>true</useStandardDocletOptions>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <reportSets>
+                  <reportSet>
+                    <reports>
+                      <!-- select non-aggregate reports -->
+                      <report>report</report>
+                    </reports>
+                  </reportSet>
+                </reportSets>
+            </plugin>
         </plugins>
     </reporting>
 
@@ -527,14 +539,50 @@ limitations under the License.
                     <artifactId>build-helper-maven-plugin</artifactId>
                     <version>1.9.1</version>
                 </plugin>
-                <plugin>
-                  <groupId>org.sonarsource.scanner.maven</groupId>
-                  <artifactId>sonar-maven-plugin</artifactId>
-                  <version>3.2</version>
-                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>
+            <!-- jacoco for testing -->
+            <plugin>
+              <groupId>org.jacoco</groupId>
+              <artifactId>jacoco-maven-plugin</artifactId>
+              <version>0.8.4</version>
+              <executions>
+                <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>
             <!-- Javadocs Plugin -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>