Add sonar related configuration in POM file. 89/103089/1
authorhekeguang <hekeguang@chinamobile.com>
Thu, 5 Mar 2020 06:09:13 +0000 (14:09 +0800)
committerhekeguang <hekeguang@chinamobile.com>
Thu, 5 Mar 2020 06:09:24 +0000 (14:09 +0800)
Issue-ID: USECASEUI-384
Change-Id: I330950fcdf4f75d48777d1a1e13da39441feee8a
Signed-off-by: hekeguang <hekeguang@chinamobile.com>
server/pom.xml

index 047ce57..d355154 100644 (file)
         <common.csv.version>1.4</common.csv.version>
         <jackson.version>2.9.8</jackson.version>
         <tomcat.version>9.0.16</tomcat.version>
+        <sonar.language>java</sonar.language>
+        <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
+        <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
+        <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
+        <sonar.projectVersion>${project.version}</sonar.projectVersion>
+        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
     </properties>
 
     <dependencyManagement>
                     </includes>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>prepare-agent</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>report</id>
+                        <goals>
+                            <goal>report</goal>
+                        </goals>
+                        <configuration>
+                            <dataFile>${project.build.directory}/code-coverage/jacoco.exec</dataFile>
+                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>