in maven-project/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java [67:183]
private void assembleModelInheritance( Model child, Model parent, String childPathAdjustment, boolean appendPaths )
{
// cannot inherit from null parent.
if ( parent == null )
{
return;
}
// Group id
if ( child.getGroupId() == null )
{
child.setGroupId( parent.getGroupId() );
}
// version
if ( child.getVersion() == null )
{
// The parent version may have resolved to something different, so we take what we asked for...
// instead of - child.setVersion( parent.getVersion() );
if ( child.getParent() != null )
{
child.setVersion( child.getParent().getVersion() );
}
}
// inceptionYear
if ( child.getInceptionYear() == null )
{
child.setInceptionYear( parent.getInceptionYear() );
}
// url
if ( child.getUrl() == null )
{
if ( parent.getUrl() != null )
{
child.setUrl( appendPath( parent.getUrl(), child.getArtifactId(), childPathAdjustment, appendPaths ) );
}
else
{
child.setUrl( parent.getUrl() );
}
}
assembleDistributionInheritence( child, parent, childPathAdjustment, appendPaths );
// issueManagement
if ( child.getIssueManagement() == null )
{
child.setIssueManagement( parent.getIssueManagement() );
}
// description
if ( child.getDescription() == null )
{
child.setDescription( parent.getDescription() );
}
// Organization
if ( child.getOrganization() == null )
{
child.setOrganization( parent.getOrganization() );
}
// Scm
assembleScmInheritance( child, parent, childPathAdjustment, appendPaths );
// ciManagement
if ( child.getCiManagement() == null )
{
child.setCiManagement( parent.getCiManagement() );
}
// developers
if ( child.getDevelopers().size() == 0 )
{
child.setDevelopers( parent.getDevelopers() );
}
// licenses
if ( child.getLicenses().size() == 0 )
{
child.setLicenses( parent.getLicenses() );
}
// developers
if ( child.getContributors().size() == 0 )
{
child.setContributors( parent.getContributors() );
}
// mailingLists
if ( child.getMailingLists().size() == 0 )
{
child.setMailingLists( parent.getMailingLists() );
}
// Build
assembleBuildInheritance( child, parent );
assembleDependencyInheritance( child, parent );
child.setRepositories( ModelUtils.mergeRepositoryLists( child.getRepositories(), parent.getRepositories() ) );
child.setPluginRepositories(
ModelUtils.mergeRepositoryLists( child.getPluginRepositories(), parent.getPluginRepositories() ) );
assembleReportingInheritance( child, parent );
assembleDependencyManagementInheritance( child, parent );
Properties props = new Properties();
props.putAll( parent.getProperties() );
props.putAll( child.getProperties() );
child.setProperties( props );
}