...
- Install the XML plugin through the Update Center or download it into the SONAR_HOME/extensions/plugins directory
- Restart the Sonar server
Usage
You can analyze your project with the different analyzers.
Sonar Runner
A list of sample projects is available on github that can be browsed or downloaded:
- XML project analyzed with the Sonar Runner: /projects/languages/xml/xml-sonar-runner.
Maven
Create a maven pom for your project. Set the following properties:
- sonar.language: xml
- sonar.xml.sourceDirectory: [folder of the xml files]
- sonar.dynamicAnalysis: false
Analysis Properties
The following properties of the plugin are configurable:
property | description | default value |
|---|---|---|
sonar.xml.sourceDirectory | folder that will be scanned (relative to project root) |
|
sonar.xml.fileExtensions | file extensions that will be scanned | xml, xhtml |
sonar.xml.includeFileFilter | additional filter for the files to be scanned |
|
sonar.xml.schemas | namespace of schema to use for validation |
|
The properties may be set in sonar, the maven pom or the maven commmandline.
In the rules profile the main checks are XMLSchemaCheck and XPathCheck. These checks are explained below.
...

