Empty modules list generated when using '--non-recursive' flag for single 
module projects
-----------------------------------------------------------------------------------------

                 Key: MSITE-237
                 URL: http://jira.codehaus.org/browse/MSITE-237
             Project: Maven 2.x Site Plugin
          Issue Type: Bug
    Affects Versions: 2.0-beta-5
            Reporter: Fernando Lindner
            Priority: Critical
         Attachments: sample-project.zip

Using '--non-recursive' flag for a single module project causes site's modules 
list to be empty.

When starting a new project it's usual to have just one module for a while.

It seems to be a problem in *org.apache.maven.plugins.site.AbstractSiteMojo" 
class,  inside {{populateModulesMenuItemsFromModels}} method, when 
{{models.size()}} is checked. 

{code:title=AbstractSiteMojo.java|borderStyle=solid}
...
    private void populateModulesMenuItemsFromModels( List models, Menu menu )
    {
        if ( models != null && models.size() > 1 )
        {
            Iterator reactorItr = models.iterator();

            while ( reactorItr.hasNext() )
            {
                Model model = (Model) reactorItr.next();

                String reactorUrl = model.getUrl();
                String name = model.getName();

                appendMenuItem( menu, name, reactorUrl, model.getArtifactId() );
            }
        }
    }
...
{code} 


A single project is attached, for testing purposes.

No errors when omitting '--non-recursive' flag:

{{mvn clean site}} 



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

        

Reply via email to