return newRepos;
}
private static DistributionManagement cloneProfileDistributionManagement( DistributionManagement dm )
{
DistributionManagement newDM = null;
if ( dm != null )
{
newDM = new DistributionManagement();
newDM.setDownloadUrl( dm.getDownloadUrl() );
newDM.setStatus( dm.getStatus() );
Relocation relocation = dm.getRelocation();
if ( relocation != null )
{
Relocation newR = new Relocation();
newR.setArtifactId( relocation.getArtifactId() );
newR.setGroupId( relocation.getGroupId() );
newR.setMessage( relocation.getMessage() );
newR.setVersion( relocation.getVersion() );
newDM.setRelocation( newR );
}
DeploymentRepository repo = dm.getRepository();
if ( repo != null )
{
DeploymentRepository newRepo = new DeploymentRepository();
newRepo.setId( repo.getId() );
newRepo.setLayout( repo.getLayout() );
newRepo.setName( repo.getName() );
newRepo.setUrl( repo.getUrl() );
newRepo.setUniqueVersion( repo.isUniqueVersion() );
newDM.setRepository( newRepo );
}
Site site = dm.getSite();
if ( site != null )
{
Site newSite = new Site();
newSite.setId( site.getId() );
newSite.setName( site.getName() );
newSite.setUrl( site.getUrl() );
newDM.setSite( newSite );
}
DeploymentRepository sRepo = dm.getSnapshotRepository();
if ( sRepo != null )
{
DeploymentRepository newRepo = new DeploymentRepository();
newRepo.setId( sRepo.getId() );
newRepo.setLayout( sRepo.getLayout() );
newRepo.setName( sRepo.getName() );
newRepo.setUrl( sRepo.getUrl() );
newRepo.setUniqueVersion( sRepo.isUniqueVersion() );
newDM.setSnapshotRepository( newRepo );
}
}
return newDM;
}