Add Sonar Kotlin support 55/75255/6
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Thu, 3 Jan 2019 21:53:40 +0000 (16:53 -0500)
committerAlexis de Talhouët <alexis.de_talhouet@bell.ca>
Fri, 4 Jan 2019 14:51:27 +0000 (14:51 +0000)
Rework parent pom so configuration can be inherited for all
modules from root ccsdk-apps/pom.xml.
Also updated some pom description so it is better presented
within Sonar.

These commands can be used locally to publish report to Sonar:

   mvn clean install -e -Dsonar
   mvn sonar:sonar -e -Dsonar -Dsonar.host.url=https://sonar.onap.org

Note: kotlin code coverage is not fully functional due to
https://github.com/jacoco/jacoco/issues/763
That issue has been fixed in jacoco master branch, but hasn't
been released. Once released, in version 0.8.3, we can override
version of jacoco plugin for ccsdk-apps.

Change-Id: Ic382a4d0df9d14a82536993d2dfa55d7f105f951
Issue-ID: CCSDK-725
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
components/parent/pom.xml
components/pom.xml
ms/blueprintsprocessor/functions/pom.xml
ms/blueprintsprocessor/modules/pom.xml
ms/blueprintsprocessor/pom.xml
ms/controllerblueprints/pom.xml
ms/neng/pom.xml
ms/pom.xml
ms/vlantag-api/pom.xml
pom.xml

index 1330279..2307a0d 100644 (file)
@@ -26,7 +26,7 @@
     </parent>
     <groupId>org.onap.ccsdk.apps.components</groupId>
     <artifactId>parent</artifactId>
-    <name>App Components Parent</name>
+    <name>Components Parent</name>
     <packaging>pom</packaging>
     <properties>
         <spring.boot.version>2.1.1.RELEASE</spring.boot.version>
index 181a781..6a2aa31 100644 (file)
@@ -23,9 +23,8 @@
         <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.onap.ccsdk.apps</groupId>
     <artifactId>components</artifactId>
-    <name>App Components Root</name>
+    <name>Components Root</name>
     <packaging>pom</packaging>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
index e4f8c84..6a560be 100644 (file)
@@ -27,8 +27,8 @@
     <modelVersion>4.0.0</modelVersion>
     <packaging>pom</packaging>
     <artifactId>functions</artifactId>
-    <name>Blueprints Processor Functions POM</name>
-    <description>Blueprints Processor Functions POM</description>
+    <name>Blueprints Processor Functions</name>
+    <description>Blueprints Processor Functions</description>
     <modules>
         <module>resource-resolution</module>
         <module>python-executor</module>
index 0230cd7..f0de54f 100644 (file)
@@ -28,7 +28,7 @@
 
     <artifactId>modules</artifactId>
     <packaging>pom</packaging>
-    <name>Blueprints Processor Modules POM</name>
+    <name>Blueprints Processor Modules</name>
     <description>Blueprints Processor Modules</description>
 
     <modules>
index 4e119b7..c6840b4 100644 (file)
        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>org.onap.ccsdk.apps</groupId>
-               <artifactId>ccsdk-apps</artifactId>
+               <artifactId>ccsdk-apps-ms</artifactId>
                <version>0.4.0-SNAPSHOT</version>
        </parent>
        <artifactId>blueprintsprocessor</artifactId>
        <packaging>pom</packaging>
-       <name>Blueprints Processor POM</name>
-       <description>Blueprints Processor POM</description>
+       <name>Blueprints Processor Root</name>
+       <description>Blueprints Processor Root</description>
 
        <properties>
                <service.name>BlueprintsProcessor</service.name>
index 4517f3f..aeff4db 100644 (file)
@@ -23,7 +23,6 @@
         <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.onap.ccsdk.apps</groupId>
     <artifactId>controllerblueprints</artifactId>
     <name>Controller Blueprints Root</name>
     <version>0.4.0-SNAPSHOT</version>
index b212ebe..1668159 100644 (file)
@@ -25,6 +25,7 @@
     <groupId>org.onap.ccsdk.apps</groupId>
     <artifactId>ccsdk-apps-ms-neng</artifactId>
     <version>0.4.0-SNAPSHOT</version>
+    <name>Naming Generation</name>
 
     <properties>
         <swagger.directory>${basedir}/target/classes/META-INF/resources/swagger</swagger.directory>
index 9a80e6f..368e91e 100644 (file)
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.onap.ccsdk.parent</groupId>
-        <artifactId>odlparent-lite</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
-        <relativePath/>
+        <groupId>org.onap.ccsdk.apps</groupId>
+        <artifactId>ccsdk-apps</artifactId>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
 
-    <groupId>org.onap.ccsdk.apps</groupId>
     <artifactId>ccsdk-apps-ms</artifactId>
     <version>0.4.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
-    <name>ccsdk-apps-ms</name>
+    <name>Micro-services Root</name>
     <description>Micro-services</description>
 
     <modules>
index de5e97a..402772a 100644 (file)
@@ -9,7 +9,7 @@
        <version>0.4.0-SNAPSHOT</version>
        <packaging>jar</packaging>
 
-       <name>vlantag-api</name>
+       <name>Vlantag API</name>
        <description>Vlantag Api Service for Vlantag management of VNFs</description>
 
        <properties>
diff --git a/pom.xml b/pom.xml
index 911d841..d6dc5c0 100755 (executable)
--- a/pom.xml
+++ b/pom.xml
                <name>ONAP</name>
        </organization>
 
+       <properties>
+               <!--Don't set any language to let sonar enable multi-language support-->
+               <sonar.language/>
+               <!--Provide src/main as source path so both src/main/java and src/main/kotlin are scanned-->
+               <sonar.sources>src/main</sonar.sources>
+               <!--Provide src/test as source path for test so both src/test/java and src/test/kotlin are scanned-->
+               <sonar.tests>src/test</sonar.tests>
+               <!--Only include java and kt files to the scan-->
+               <sonar.inclusions>**/*.java,**/*.kt</sonar.inclusions>
+               <!--Specify path to load jacoco XLM report, as Sonar can't load Kotlin coverage from binary report.
+               Note: coverage for now is invalid and is failing to load because of:
+               "Cannot import coverage information for file '{file}', coverage data is invalid."
+               see https://github.com/jacoco/jacoco/issues/763
+               That issue has been fixed in 0.8.3 but haven't yet been release. -->
+               <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
+       </properties>
+
        <modules>
                <module>components</module>
                <module>ms</module>
        </modules>
 
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.jacoco</groupId>
+                               <artifactId>jacoco-maven-plugin</artifactId>
+                               <!--Change version to 0.8.3 when released-->
+                               <version>${jacoco.version}</version>
+                       </plugin>
+               </plugins>
+       </build>
+
        <scm>
                <connection>scm:git:ssh://git@${onap.git.host}/apps.git</connection>
                <developerConnection>scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/apps.git</developerConnection>
                <url>${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/apps/browse</url>
        </scm>
 
-
        <profiles>
                <profile>
                        <id>blackduck</id>
@@ -71,4 +98,5 @@
                </profile>
 
        </profiles>
+
 </project>