Apigee sonarqube plugin,Apigee sonar plugin

How can i configure apigee sonar plugin with maven

is there any sample available

,

How to configure apigee sonar plugin with maen

is there any maven plugin available for Apigee sonar plugin

if it is available then how to specify followng parameters

-Dsonar.language=

' + '-Dsonar.sources=

0 4 1,168
4 REPLIES 4

Hello,

What your are looking for is here :

https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven

Prerequisites :

Then, just create a pom.xml like this :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.example</groupId>
  <artifactId>MyAwfulProxy</artifactId>
  <version>1</version>

  <name>MyAfwulProxy from Apigee</name>
  <description>MyAfwulProxy from Apigee.</description>
  
  <properties>
    <sonar.host.url>http://localhost:9000</sonar.host.url> <!-- Overides the host from settings.xml -->
    <sonar.projectKey>MyAwfulProxy</sonar.projectKey>
    <sonar.sources>./src/main/resources/apiproxy</sonar.sources>

    <!-- Optionnal -->
    <sonar.projectName>MyAwfulProxy</sonar.projectName>
    <sonar.projectVersion>1</sonar.projectVersion>
    <sonar.scm.disabled>true</sonar.scm.disabled>
  </properties>

</project>

At last, run

mvn clean sonar:sonar

Successfully tested with the MyAwfulProxy.zip provided in the Sonar Apigee Plugin releases.

Shouldnt the <sonar.sources> be the following? When I edited mine to the below setting, I could get the analysis working

<sonar.sources>./apiproxy</sonar.sources>

Yes, the <sonar.source> value only depends on the path from which you are running mvn. It's relative to the directory where the pom.xml is.

In my example, my apiproxy directory is in subdirectories of the Sonar Apigee plugin (src/main/resources/...) because I'm its author.

In your case, it's up to you to change the path or run mvn from where you prefer.

@Nicolas TISSERAND Understood it now.