-
Type:
Bug
-
Resolution: Cannot Reproduce
-
Priority:
Major
-
Component/s: sonar-plugin
-
None
-
Environment:Hudson 1.346
Sonar plugin 1.2.2
I'm using Sonar with several ant-based projects that have multiple source directories. Thus I'm selecting "Check if this project is NOT built with maven 2" and entering a comma separated list of source directories. In the console output when it lists the source directories the first directory is not listed, nor does it appear in the generated pom.xml.
The problem appears to be in SonarPomGenerator.generateSrcDirsPluginTemplate:
for (int i = 1; i < srcDirs.size(); i++) { sourcesXml.append("<source><![CDATA[").append(StringUtils.trim(srcDirs.get(i))).append("]]></source>\n"); }
Looks like the for loop should start at 0 because srcDirs is a List. Or, better yet, use for (String srcDir : srcDirs) ...