Dependency reporting plugin overwrites other project's artifact file
--------------------------------------------------------------------

                 Key: MNG-3755
                 URL: http://jira.codehaus.org/browse/MNG-3755
             Project: Maven 2
          Issue Type: Bug
          Components: Sites & Reporting
    Affects Versions: 2.0.9, 2.0.8
         Environment: Linux
            Reporter: Vesa Vilhonen


Projectmap is map of artifacts with groupid:artifactid being the key. When 
project has multiple artifacts only one of them is put to the map. Dependency 
node contains information about artifact and file information is the same 
reference as used DefaultLifecycleExecutor. Every dependency's file is set from 
this map and when building multimodule projects the latter projects may fail 
because project's default artifact file is set to one of its attached artifacts.


In org.apache.maven.report.projectinfo.dependencies.Dependencies

private void mapArtifactFiles( DependencyNode node, Map projectMap )
    {
        List childs = node.getChildren();
        if ( ( childs == null ) || childs.isEmpty() )
        {
            return;
        }

        Iterator it = childs.iterator();
        while ( it.hasNext() )
        {
            DependencyNode anode = (DependencyNode) it.next();
            String key = ArtifactUtils.versionlessKey( anode.getArtifact() );
            Artifact projartifact = (Artifact) projectMap.get( key );
            if ( projartifact != null )
            {
                anode.getArtifact().setFile( projartifact.getFile() );
            }

            mapArtifactFiles( anode, projectMap );
        }
    }

-- 
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