mirror of https://github.com/apache/archiva.git
check if metadata exists first before updating and copying to target repo
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1022822 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
421229b886
commit
b719ecb818
|
@ -187,6 +187,9 @@ public class Maven2RepositoryMerger
|
|||
pathTranslator.toFile( new File( sourceRepoPath ), artifactMetadata.getNamespace(),
|
||||
artifactMetadata.getProject(), artifactMetadata.getVersion(),
|
||||
METADATA_FILENAME );
|
||||
|
||||
if( versionMetaDataFileInSourceRepo.exists() )
|
||||
{
|
||||
String relativePathToVersionMetadataFile =
|
||||
versionMetaDataFileInSourceRepo.getAbsolutePath().split( sourceRepoPath )[1];
|
||||
File versionMetaDataFileInTargetRepo = new File( targetRepoPath, relativePathToVersionMetadataFile );
|
||||
|
@ -200,11 +203,14 @@ public class Maven2RepositoryMerger
|
|||
updateVersionMetadata( versionMetaDataFileInTargetRepo, artifactMetadata, lastUpdatedTimestamp );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// updating project meta data file
|
||||
String projectDirectoryInSourceRepo = new File( versionMetaDataFileInSourceRepo.getParent() ).getParent();
|
||||
File projectMetadataFileInSourceRepo = new File( projectDirectoryInSourceRepo, METADATA_FILENAME );
|
||||
|
||||
if( projectMetadataFileInSourceRepo.exists() )
|
||||
{
|
||||
String relativePathToProjectMetadataFile =
|
||||
projectMetadataFileInSourceRepo.getAbsolutePath().split( sourceRepoPath )[1];
|
||||
File projectMetadataFileInTargetRepo = new File( targetRepoPath, relativePathToProjectMetadataFile );
|
||||
|
@ -212,7 +218,7 @@ public class Maven2RepositoryMerger
|
|||
if ( !projectMetadataFileInTargetRepo.exists() )
|
||||
{
|
||||
|
||||
copyFile( versionMetaDataFileInSourceRepo, projectMetadataFileInSourceRepo );
|
||||
copyFile( projectMetadataFileInSourceRepo, projectMetadataFileInSourceRepo );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -220,6 +226,7 @@ public class Maven2RepositoryMerger
|
|||
timestamp );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue