int newBuildNumber = -1;
String timestamp = null;
- File versionMetadataFile = getMetadata( targetPath.getAbsolutePath() );
+ File versionMetadataFile = new File( targetPath, MetadataTools.MAVEN_METADATA );
ArchivaRepositoryMetadata versionMetadata = getMetadata( versionMetadataFile );
if ( VersionUtil.isSnapshot( version ) )
return pomFile;
}
- private File getMetadata( String targetPath )
- {
- return new File( targetPath, MetadataTools.MAVEN_METADATA );
- }
-
private ArchivaRepositoryMetadata getMetadata( File metadataFile )
throws RepositoryMetadataException
{
List<String> availableVersions = new ArrayList<String>();
String latestVersion = version;
- String projectPath = targetPath.substring( 0, targetPath.lastIndexOf( File.separatorChar ) );
- File projectMetadataFile = getMetadata( projectPath );
+ File projectDir = new File( targetPath ).getParentFile();
+ File projectMetadataFile = new File( projectDir, MetadataTools.MAVEN_METADATA );
+
ArchivaRepositoryMetadata projectMetadata = getMetadata( projectMetadataFile );
if ( projectMetadataFile.exists() )