0

I am running into two issues using the XML Schema Validation rule in SonarQube 4.0 (XML plugin version 1.0.1):

  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).
  2. 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
  • IBM JDK is not supported. See http://docs.codehaus.org/display/SONAR/Requirements. Could you please try again with a supported JDK? Could you please provide a project sample if you still reproduce the issue? – David RACODON - QA Consultant Jan 06 '14 at 15:32
  • There is a dependent problem using the Sun JDK that Freddy Mallet has created a ticket for. See http://stackoverflow.com/questions/20664149/jenkins-sonarqube-4-0-classnotfoundexception-occurs-durng-xhtml-validation-che This is why I was using the IBM JDK. – Dan Lucovic Jan 06 '14 at 16:26
  • OK. Could you please provide a sample project to reproduce your issue? – David RACODON - QA Consultant Jan 07 '14 at 09:07
  • I assume you mean the Java project exported from Eclipse and not the project in SonarQube itself or the Jenkins job. How do I get that over to you (SO newb here)? – Dan Lucovic Jan 07 '14 at 17:29
  • Your Java project, not the SonarQube one. You can move to the user mailing list to post a sample project. See http://www.sonarqube.org/resources/join-our-community/ – David RACODON - QA Consultant Jan 07 '14 at 17:51
  • Thanks David. I have posted the sample project along with the Sonar rule configuration to the Sonar User mailing list. – Dan Lucovic Jan 14 '14 at 15:46
  • Did you resolve this? I'm having the same issue where only root files are matched. – jam01 Mar 09 '19 at 00:34

0 Answers0