如何将soapUI(免费版) HTML报告集成至SonarQube 5.6及配置方法
Great question! Since soapUI Free doesn’t have a dedicated SonarQube plugin, we’ll use SonarQube’s built-in support for generic test metrics and a workaround to display the full HTML report. Here’s a step-by-step breakdown of what you need to do:
Step 1: Generate Required Reports from soapUI
First, generate both a JUnit XML report (for SonarQube to parse test pass/fail metrics) and your desired HTML report using soapUI’s command-line test runner:
For Windows:
testrunner.bat -r -j -f "C:\your-report-directory" -F HTML your-soapui-project.xml
For Linux/macOS:
testrunner.sh -r -j -f ./your-report-directory -F HTML your-soapui-project.xml
-j: Triggers JUnit XML report generation (critical for SonarQube to import test statistics)-F HTML: Ensures the full HTML test report is created-f: Specifies the output folder for both reports
Step 2: Configure SonarQube to Import Test Metrics
SonarQube 5.6 has native support for JUnit reports. Add these properties to your sonar-project.properties file (or pass them as command-line arguments when running the SonarQube scanner):
# Path to the JUnit XML report generated by soapUI (wildcard works for multiple reports) sonar.junit.reportsPath=./your-report-directory/TEST-*.xml # Optional: Mark test failures as critical errors in SonarQube sonar.junit.failuresAsErrors=true
Run the SonarQube scanner as usual, and you’ll see test pass/fail rates and metrics in your project dashboard.
Step 3: Display the soapUI HTML Report in SonarQube
Since direct embedding of HTML reports isn’t natively supported in SonarQube 5.6, use one of these reliable workarounds:
Option 1: Add a Custom Project Link (Simplest)
Log into your SonarQube 5.6 instance
Navigate to your project → Settings → General Settings → Links
Create a new link with:
- Name: soapUI Test Report
- URL: The full HTTP path to your hosted HTML report (e.g.,
http://your-internal-server/soapui-reports/your-test-report.html)
Note: Host the HTML report on a web server (Apache, Nginx, or a shared network drive accessible via HTTP) so all SonarQube users can view it.
Option 2: Custom Plugin (Advanced)
If you want the report embedded directly in SonarQube, you’d need to build a simple custom plugin that adds a new tab to your project dashboard and loads the HTML report. This requires basic Java development skills, but it’s a more seamless solution for teams that use this workflow regularly.
Key Notes
- Ensure the SonarQube scanner has read access to the JUnit report directory
- SonarQube 5.6 is an older version (released in 2017)—upgrading to a newer version would unlock native HTML report embedding features, but the steps above work reliably for 5.6.
内容的提问来源于stack exchange,提问作者snP

