I am running into two issues using the XML Schema Validation rule in SonarQube 4.0 (XML plugin version 1.0.1):
- It takes consistently 10 minutes to validate each file against each schema (not good when project has 277 XHTML - really JSF 2.0 - files).
- File pattern matching does not work consistently.
Are these bugs in the Sonar XML plugin or am I doing something wrong?
Configuration:
- Jenkins 1.509.2 job triggering SonarQube analysis using Maven 3.0.3 post-build action.
- IBM Java 1.6 JDK 32-bit.
- Windows Server 2003 64-bit operating system.
- Sonar XML quality profile: four XML schema rule occurrences to validate against each XML schema separately (XHTML transitional plus three JSF schema).
XML schema rule filePattern parameter:
**/*.xhtml
- Default rule will match Login.xhtml but not resources/Login.xhtml.
- If I copy the rule and then use the exact same file pattern, the reverse happens. The copied rule will match resources/Login.xhtml but not Login.xhtml.
Job output (note the timestamps and evidence of file pattern match):
[INFO] [15:13:41.413] Source encoding: windows-1252, default locale: en_US
[INFO] [15:13:41.523] Sensor XmlSourceImporter...
[INFO] [15:13:45.492] Sensor XmlSourceImporter done: 3969 ms
[INFO] [15:13:45.492] Sensor XmlSensor...
[INFO] [15:13:45.539] Validate admin/Information.xhtml with schema http://java.sun.com/jsf/core
[INFO] [15:23:38.468] Validate admin/Information.xhtml with schema http://java.sun.com/jsf/facelets
[INFO] [15:33:09.333] Validate admin/Information.xhtml with schema http://java.sun.com/jsf/html
[INFO] [15:42:40.168] Validate Exit.xhtml with schema http://java.sun.com/jsf/core
[INFO] [15:52:12.346] Validate Exit.xhtml with schema xhtml1-transitional
[INFO] [16:01:43.243] Validate Exit.xhtml with schema http://java.sun.com/jsf/facelets
[INFO] [16:11:14.046] Validate Exit.xhtml with schema http://java.sun.com/jsf/html
[INFO] [16:20:45.084] Validate Login.xhtml with schema http://java.sun.com/jsf/core
[INFO] [16:30:15.934] Validate Login.xhtml with schema xhtml1-transitional
[INFO] [16:39:47.002] Validate Login.xhtml with schema http://java.sun.com/jsf/facelets
[INFO] [16:49:17.899] Validate Login.xhtml with schema http://java.sun.com/jsf/html