I have used sonar-maven3-plugin 3.5.1 version to generate PDF report. I have followed the steps as follows:
Dependency in pom:
dependency>
<groupId>org.codehaus.sonar-plugins.pdf-report</groupId>
<artifactId>sonar-pdfreport-plugin</artifactId>
<version>1.3.1</version>
</dependency>
Goal:
mvn Sonar:sonar
I could able to see the PDF report generated under target/sonar/ folder. But when i open Sonar Qube GUI from //localhost:9000, I don't find any PDF file generated for my Project. Where should i look for that PDF file in Sonar Qube GUI
I'm using Google Chrome to get Sonar report in PDF format. Please find below the steps:
Use Google Chrome to open the sonar report as custom dashboard
Just press 'ctrl+P'
Change the printer settings 'pdf'
And save the file
By this way you can the report in PDF format.
Related
I am running my JMeter scripts from Jenkins via jmeter-maven-plugin. The jtl file gets generated successfully. But not able to automatically generate the Aggregate report from the jtl file. Looks like maven does not create the JMeterPluginsCMD Command Line Tool even after adding the below dependency in pom.xml
<jmeterExtension>kg.apc:jmeter-plugins-cmd:2.2</jmeterExtension>
Please help on how to configure JMeter to create the Aggregate report, so that I can archive the report in Jenkins and make it available for download.
First of all your syntax is not correct, it should be something like:
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-cmd:2.2<</artifact>
</jmeterExtensions>
Second, JMeter Maven Plugin provides possibility to generate HTML Reporting Dashboard given you have the following line in your POM file:
<generateReports>true</generateReports>
and the dashboard has its own version of the Aggregate Report table (plus APDEX plus interactive zoomable charts)
More information: How to Use the JMeter Maven Plugin
I have a multimodule Maven project where the coverage reports are located in another module than the covered Java classes. An import of a not empty xml coverage report (with coverage information) into Sonarqube is successful but shows a coverage of 0.
Steps to reproduce:
Checkout following github project and build it with mvn clean verify. After that there exist an aggregated xml report located in coverage/target/site/jacoco-aggregate-all/jacoco.xml. You can see coverage data in there and also in the corresponding html-Report.
Start sonarqube (current version 8.4.1) with following command and wait a little bit.
docker run -d -p 9000:9000 sonarqube
edit: Plugin "JaCoco xml report importer" is already installed in this image.
Publish coverage data with following (verbose) command. Importing of report was successful (see log).
mvn sonar:sonar -X -Dsonar.projectKey=example -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco-aggregate-all/jacoco.xml
## Log output contains
...
10:54:28.519 Reading report '<project-path>\maven-multimodule-coverage\coverage\target\site\jacoco-aggregate-all\jacoco.xml'
...
Browse to http://localhost:9000/dashboard?id=example. You see coverage of 0.
What am I doing wrong?
It turned out that it works if I use an absolute path for the xml report file. So I added
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../coverage/target/site/jacoco-aggregate-all/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
to the top maven pom so each module points to the same report file. For a deeper nesting of module directories you have to introduce a property main.basedir or something.
The main understanding is that you do not provide sonar a coverage report which get mapped to the module classes, but you provide module classes which get mapped to a coverage report.
Please install JaCoco xml report importer plugin on sonarqube instance (you will find it under marketplace just search for jacoco there). This plugin will pick up your code coverage and import it to sonarqube. so after installing plugin please use the same command to see result on sonarqube which is
mvn sonar:sonar -X -Dsonar.projectKey=example -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco-aggregate-all/jacoco.xml
I have installed 3.7.4 Sonar server in my machine. And also installed PDF plugin in the server. I also installed sonar-runner-2.4. And run the sonar runner on java project. Now, I can see the metrics in WebInterface of Sonar server(by using localhost:9000). But, I need to generated PDF of this metrics. I unable to find where download option is available. Can any body help to move forward.
Note: PDF plugin is already installed
I downloaded a maven project from this link
Project samples are available on github that can be browsed or downloaded: projects/languages/java/code-coverage/ut
When I run "mvn clean test sonar:sonar" from the command line, I see the jacoco.exe file getting generated and shows the report in SONAR. What can I do to NOT show this code coverage report on the SONAR?
Can you please tell me the settings that I need to make?
Thanks.
I don't know your SonarQube version but I guess launching the same command with "-Dsonar.dynamicAnalysis=false" should do the job.
I have a cobertura.ser file, that got generated while integration-test and system test. Now I want to import my coverage this to sonar server.
How can I achieve this, so while executing mvn sonar:sonar the coverage should consider external coberture.ser file?
Can I do this using sonar, where i can see overall coverage obtain during all test run?
You need to set the following paramater to tell Sonar to use a pre-generated report:
sonar.dynamicAnalysis=reuseReports
Secondly Sonar doesn't read the "cobertura.ser" file. It can be configured as follows to read the generated XML report (See cobertura docs):
sonar.cobertura.reportPath=target/reports/coverage.xml
Finally, my reference for all this stuff comes from the from the Sonar wiki:
http://docs.codehaus.org/display/SONAR/Advanced+Parameters
http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Unit+Tests
http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests
The Sonarsource tutorials are increasingly pushing JaCoCo. This appears to be an emerging standard (replacing the older defunct Emma project)