don't inherit whole objects, must clone them

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@169801 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-05-12 10:25:35 +00:00
parent 76d49b7d7b
commit 3e43906df3
1 changed files with 20 additions and 6 deletions

View File

@ -438,9 +438,16 @@ private void assembleDistributionInheritence( Model child, Model parent )
{
if ( parentDistMgmt.getSite() != null )
{
childDistMgmt.setSite( parentDistMgmt.getSite() );
Site site = new Site();
childDistMgmt.setSite( site );
site.setId( parentDistMgmt.getSite().getId() );
site.setName( parentDistMgmt.getSite().getName() );
site.setUrl( parentDistMgmt.getSite().getUrl() );
Site site = childDistMgmt.getSite();
if ( site.getUrl() != null && site.getUrl().endsWith( "/" ) )
{
site.setUrl( site.getUrl() + child.getArtifactId() + "/" );
@ -452,12 +459,19 @@ private void assembleDistributionInheritence( Model child, Model parent )
{
if ( parentDistMgmt.getRepository() != null )
{
childDistMgmt.setRepository( parentDistMgmt.getRepository() );
Repository repository = new Repository();
Repository repo = childDistMgmt.getRepository();
if ( repo.getUrl() != null && repo.getUrl().endsWith( "/" ) )
childDistMgmt.setRepository( repository );
repository.setId( parentDistMgmt.getRepository().getId() );
repository.setName( parentDistMgmt.getRepository().getName() );
repository.setUrl( parentDistMgmt.getRepository().getUrl() );
if ( repository.getUrl() != null && repository.getUrl().endsWith( "/" ) )
{
repo.setUrl( repo.getUrl() + child.getArtifactId() + "/" );
repository.setUrl( repository.getUrl() + child.getArtifactId() + "/" );
}
}
}