Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

-- this plugin is under development - plan is to release in januari 2011 -- 


The plugin provides static code analysis of XML files within Sonar. 

The following functionality is provided:

  • sizing (files, lines of code)
  • XPath rules
  • XML schema validation

The plugin scans the following files by default: .xml, .xhtml. The file extensions are configurable. 

The plugin imports the XML files in Sonar, and performs the validations. The checks are configurable in the Sonar rules repository. 

Use Cases

Typical use cases:

- validation of XHTML files

- validation of rules in maven pom files. 

Usage & Installation


  1. Copy the jar into /extensions/plugins/ directory
  2. Restart Sonar Web server

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

Sample pom file:

Quick analysis
For an existing maven project, you might start an analysis by the following command:

You may set the property sonar.branch to make sure the analysis will be reported in sonar under another project name, e.g. -Dsonar.branch=Xml.

XPath Rules

content to be provided

Schema Validation

content to be provided


The following properties of the plugin are configurable:


default value




xml, xhtml

The properties may be set in sonar, the maven pom or the maven commmandline.

Plugin Architecture

The plugin uses the Xerces library for parsing and validation.


to be provided

  • No labels