mirror of https://github.com/apache/maven.git
o Fixed formats for inheritance assembler additions
o Removed unused import on defaults injector. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163331 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
64f75b8aa0
commit
2ce3a6cbde
|
@ -9,7 +9,6 @@ import java.util.TreeMap;
|
||||||
|
|
||||||
import org.apache.maven.model.Dependency;
|
import org.apache.maven.model.Dependency;
|
||||||
import org.apache.maven.model.DependencyManagement;
|
import org.apache.maven.model.DependencyManagement;
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jdcasey Created on Feb 1, 2005
|
* @author jdcasey Created on Feb 1, 2005
|
||||||
|
|
|
@ -140,14 +140,13 @@ public class DefaultModelInheritanceAssembler
|
||||||
child.setScm( childScm );
|
child.setScm( childScm );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( StringUtils.isEmpty( childScm.getConnection() ) &&
|
if ( StringUtils.isEmpty( childScm.getConnection() ) && !StringUtils.isEmpty( parentScm.getConnection() ) )
|
||||||
!StringUtils.isEmpty( parentScm.getConnection() ) )
|
|
||||||
{
|
{
|
||||||
childScm.setConnection( parentScm.getConnection() + "/" + child.getArtifactId() );
|
childScm.setConnection( parentScm.getConnection() + "/" + child.getArtifactId() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( StringUtils.isEmpty( childScm.getDeveloperConnection() ) &&
|
if ( StringUtils.isEmpty( childScm.getDeveloperConnection() )
|
||||||
!StringUtils.isEmpty( parentScm.getDeveloperConnection() ) )
|
&& !StringUtils.isEmpty( parentScm.getDeveloperConnection() ) )
|
||||||
{
|
{
|
||||||
childScm.setDeveloperConnection( parentScm.getDeveloperConnection() + "/" + child.getArtifactId() );
|
childScm.setDeveloperConnection( parentScm.getDeveloperConnection() + "/" + child.getArtifactId() );
|
||||||
}
|
}
|
||||||
|
@ -328,12 +327,14 @@ public class DefaultModelInheritanceAssembler
|
||||||
}
|
}
|
||||||
|
|
||||||
DependencyManagement parentDepMgmt = parent.getDependencyManagement();
|
DependencyManagement parentDepMgmt = parent.getDependencyManagement();
|
||||||
|
|
||||||
DependencyManagement childDepMgmt = child.getDependencyManagement();
|
DependencyManagement childDepMgmt = child.getDependencyManagement();
|
||||||
if(parentDepMgmt != null)
|
|
||||||
|
if ( parentDepMgmt != null )
|
||||||
{
|
{
|
||||||
if(childDepMgmt == null)
|
if ( childDepMgmt == null )
|
||||||
{
|
{
|
||||||
child.setDependencyManagement(parentDepMgmt);
|
child.setDependencyManagement( parentDepMgmt );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -343,20 +344,20 @@ public class DefaultModelInheritanceAssembler
|
||||||
for ( Iterator it = parentDeps.iterator(); it.hasNext(); )
|
for ( Iterator it = parentDeps.iterator(); it.hasNext(); )
|
||||||
{
|
{
|
||||||
Dependency dep = (Dependency) it.next();
|
Dependency dep = (Dependency) it.next();
|
||||||
mappedParentDeps.put(dep.getManagementKey(), dep);
|
mappedParentDeps.put( dep.getManagementKey(), dep );
|
||||||
}
|
}
|
||||||
|
|
||||||
List deps = new ArrayList(parentDeps);
|
List deps = new ArrayList( parentDeps );
|
||||||
for ( Iterator it = childDepMgmt.getDependencies().iterator(); it.hasNext(); )
|
for ( Iterator it = childDepMgmt.getDependencies().iterator(); it.hasNext(); )
|
||||||
{
|
{
|
||||||
Dependency dep = (Dependency) it.next();
|
Dependency dep = (Dependency) it.next();
|
||||||
if(!mappedParentDeps.containsKey(dep.getManagementKey()))
|
if ( !mappedParentDeps.containsKey( dep.getManagementKey() ) )
|
||||||
{
|
{
|
||||||
deps.add(dep);
|
deps.add( dep );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
childDepMgmt.setDependencies(deps);
|
childDepMgmt.setDependencies( deps );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue