Hi All,

I've noticed that in
org.apache.maven.project.inheritance.DefaultModelInheritanceAssembler, the
method below:
private void assembleDependencyInheritance( Model child, Model parent )
    {
        Map depsMap = new HashMap();

        List deps = parent.getDependencies();

        if ( deps != null )
        {
            for ( Iterator it = deps.iterator(); it.hasNext(); )
            {
                Dependency dependency = (Dependency) it.next();
                depsMap.put( dependency.getManagementKey(), dependency );
            }
        }

        deps = child.getDependencies();

        if ( deps != null )
        {
            for ( Iterator it = deps.iterator(); it.hasNext(); )
            {
                Dependency dependency = (Dependency) it.next();
                depsMap.put( dependency.getManagementKey(), dependency );
            }
        }

        child.setDependencies( new ArrayList( depsMap.values() ) );
    }

is called by the buildFromRepository method in
org.apache.maven.project.DefaultProjectBuilder (and I'm sure a few other
places too). The effect it has, is that the dependencies in the pom of the
project, come back in a different order to how they were declared in the
pom.

Now, I'm guessing the reason for the above code being implemented the way it
is, is to allow easy handling of potential duplicates, the only problem is
that the order is lost in the process. Or is this intentional, if it is can
you explain why? If its not, I would think that there would be a large
benefit in changing the above code so that it maintains the order. I'm happy
to submit a JIRA request with my patch for it if that is the case.

Regards
Gareth Tilley
-- 
View this message in context: 
http://www.nabble.com/Dependency-order-in-DefaultModelInheritanceAssembler-tf2187909.html#a6052791
Sent from the Maven Developers forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to