[JIRA] Created: (HUDSON-5742) With a sonar "light" configuration and multiple source directories, the first one is ignored

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] Created: (HUDSON-5742) With a sonar "light" configuration and multiple source directories, the first one is ignored

Hudson issues mailing list
With a sonar "light" configuration and multiple source directories, the first one is ignored
--------------------------------------------------------------------------------------------

                 Key: HUDSON-5742
                 URL: http://issues.hudson-ci.org/browse/HUDSON-5742
             Project: Hudson
          Issue Type: Bug
          Components: sonar
         Environment: Hudson 1.346
Sonar plugin 1.2.2
            Reporter: sstock
            Assignee: sonarteam


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|https://hudson.dev.java.net/svn/hudson/tags/sonar-1.2.2/src/main/java/hudson/plugins/sonar/template/SonarPomGenerator.java].generateSrcDirsPluginTemplate:
{code:java}
    for (int i = 1; i < srcDirs.size(); i++) {
      sourcesXml.append("<source><![CDATA[").append(StringUtils.trim(srcDirs.get(i))).append("]]></source>\n");
    }
{code}

Looks like the for loop should start at 0 because srcDirs is a List.  Or, better yet, use {{for (String srcDir : srcDirs) ...}}

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (HUDSON-5742) With a sonar "light" configuration and multiple source directories, the first one is ignored

Hudson issues mailing list

    [ http://issues.hudson-ci.org/browse/HUDSON-5742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=136253#action_136253 ]

godin commented on HUDSON-5742:
-------------------------------

First source folder goes to pom.xml build/src and others to maven-build-helper plugin, so "for" correctly starts from 1. But I'll recheck multi-source non-maven projects.

> With a sonar "light" configuration and multiple source directories, the first one is ignored
> --------------------------------------------------------------------------------------------
>
>                 Key: HUDSON-5742
>                 URL: http://issues.hudson-ci.org/browse/HUDSON-5742
>             Project: Hudson
>          Issue Type: Bug
>          Components: sonar
>         Environment: Hudson 1.346
> Sonar plugin 1.2.2
>            Reporter: sstock
>            Assignee: sonarteam
>
> 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|https://hudson.dev.java.net/svn/hudson/tags/sonar-1.2.2/src/main/java/hudson/plugins/sonar/template/SonarPomGenerator.java].generateSrcDirsPluginTemplate:
> {code:java}
>     for (int i = 1; i < srcDirs.size(); i++) {
>       sourcesXml.append("<source><![CDATA[").append(StringUtils.trim(srcDirs.get(i))).append("]]></source>\n");
>     }
> {code}
> Looks like the for loop should start at 0 because srcDirs is a List.  Or, better yet, use {{for (String srcDir : srcDirs) ...}}

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[JIRA] Updated: (HUDSON-5742) With a sonar "light" configuration and multiple source directories, the first one is ignored

Hudson issues mailing list
In reply to this post by Hudson issues mailing list

     [ http://issues.hudson-ci.org/browse/HUDSON-5742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

godin updated HUDSON-5742:
--------------------------

    Attachment: HUDSON-5742.tar.gz

Attached test project: this project contains two source directories (src1 and src2) and generated pom.xml. This project can be sucessfully analyzed with Hudson Sonar Plugin.

So, this issue closed. But if you can provide another test-project, on which plugin failed, then feel free to reopen this issue.

> With a sonar "light" configuration and multiple source directories, the first one is ignored
> --------------------------------------------------------------------------------------------
>
>                 Key: HUDSON-5742
>                 URL: http://issues.hudson-ci.org/browse/HUDSON-5742
>             Project: Hudson
>          Issue Type: Bug
>          Components: sonar
>         Environment: Hudson 1.346
> Sonar plugin 1.2.2
>            Reporter: sstock
>            Assignee: sonarteam
>         Attachments: HUDSON-5742.tar.gz
>
>
> 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|https://hudson.dev.java.net/svn/hudson/tags/sonar-1.2.2/src/main/java/hudson/plugins/sonar/template/SonarPomGenerator.java].generateSrcDirsPluginTemplate:
> {code:java}
>     for (int i = 1; i < srcDirs.size(); i++) {
>       sourcesXml.append("<source><![CDATA[").append(StringUtils.trim(srcDirs.get(i))).append("]]></source>\n");
>     }
> {code}
> Looks like the for loop should start at 0 because srcDirs is a List.  Or, better yet, use {{for (String srcDir : srcDirs) ...}}

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[JIRA] Closed: (HUDSON-5742) With a sonar "light" configuration and multiple source directories, the first one is ignored

Hudson issues mailing list
In reply to this post by Hudson issues mailing list

     [ http://issues.hudson-ci.org/browse/HUDSON-5742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

godin closed HUDSON-5742.
-------------------------

    Resolution: Cannot Reproduce

> With a sonar "light" configuration and multiple source directories, the first one is ignored
> --------------------------------------------------------------------------------------------
>
>                 Key: HUDSON-5742
>                 URL: http://issues.hudson-ci.org/browse/HUDSON-5742
>             Project: Hudson
>          Issue Type: Bug
>          Components: sonar
>         Environment: Hudson 1.346
> Sonar plugin 1.2.2
>            Reporter: sstock
>            Assignee: sonarteam
>         Attachments: HUDSON-5742.tar.gz
>
>
> 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|https://hudson.dev.java.net/svn/hudson/tags/sonar-1.2.2/src/main/java/hudson/plugins/sonar/template/SonarPomGenerator.java].generateSrcDirsPluginTemplate:
> {code:java}
>     for (int i = 1; i < srcDirs.size(); i++) {
>       sourcesXml.append("<source><![CDATA[").append(StringUtils.trim(srcDirs.get(i))).append("]]></source>\n");
>     }
> {code}
> Looks like the for loop should start at 0 because srcDirs is a List.  Or, better yet, use {{for (String srcDir : srcDirs) ...}}

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]