]> source.dussan.org Git - archiva.git/commitdiff
take care of metadata files with id as maven-metadata-archiva-vm-all-public.xml
authorOlivier Lamy <olamy@apache.org>
Mon, 28 May 2012 22:52:23 +0000 (22:52 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 28 May 2012 22:52:23 +0000 (22:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1343415 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/AbstractNexusRepositorySearch.java
archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java

index d9e1415e1971497f091e3321f76b7aff81c90bc3..0e21d5d8819a3974f7f655516cb9d904aa3a45ae 100644 (file)
@@ -240,7 +240,7 @@ public abstract class AbstractNexusRepositorySearch
 
         public void artifactDiscovered( ArtifactContext ac )
         {
-            log.debug( "artifactDiscovered " + ac.getArtifact().getPath() + ":" + ac.getArtifactInfo() );
+            log.debug( "artifactDiscovered {}:", ac.getArtifact().getPath(), ac.getArtifactInfo() );
         }
     }
 
index 0d99110a37bb167d6cc0d070438678be60f49f8a..bb9cc49cb46424645d47b39388a7b7e2a487bd6d 100644 (file)
@@ -178,10 +178,9 @@ public class DefaultMetadataResolver
                 repositoryStorage.listRootNamespaces( repoId, new ExcludesFilter<String>( namespaces ) );
             if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
             {
-                if ( log.isDebugEnabled() )
-                {
-                    log.debug( "Resolved root namespaces from storage: " + storageNamespaces );
-                }
+
+                log.debug( "Resolved root namespaces from storage: {}", storageNamespaces );
+
                 for ( String n : storageNamespaces )
                 {
                     try
@@ -221,6 +220,7 @@ public class DefaultMetadataResolver
             {
 
                 log.debug( "Resolved namespaces from storage: {}", storageNamespaces );
+
                 for ( String n : storageNamespaces )
                 {
                     try
@@ -368,10 +368,9 @@ public class DefaultMetadataResolver
                 repositoryStorage.readArtifactsMetadata( repoId, namespace, projectId, projectVersion, filter );
             if ( storageArtifacts != null && !storageArtifacts.isEmpty() )
             {
-                if ( log.isDebugEnabled() )
-                {
-                    log.debug( "Resolved artifacts from storage: " + storageArtifacts );
-                }
+
+                log.debug( "Resolved artifacts from storage: {}", storageArtifacts );
+
                 for ( ArtifactMetadata artifact : storageArtifacts )
                 {
                     try
index 61102dea4ac6cae2c01af7c9ffca967b5b4b2be2..cf27e99c851fd9419d2a54e2ae3c973360f305cd 100644 (file)
@@ -46,6 +46,7 @@ import org.apache.archiva.model.SnapshotVersion;
 import org.apache.archiva.proxy.common.WagonFactory;
 import org.apache.archiva.reports.RepositoryProblemFacet;
 import org.apache.archiva.xml.XMLException;
+import org.apache.commons.lang.StringUtils;
 import org.apache.maven.model.CiManagement;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.IssueManagement;
@@ -126,7 +127,9 @@ public class Maven2RepositoryStorage
 
     private final static Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class );
 
-    private static final String METADATA_FILENAME = "maven-metadata.xml";
+    private static final String METADATA_FILENAME_START = "maven-metadata";
+
+    private static final String METADATA_FILENAME = METADATA_FILENAME_START + ".xml";
 
 
     @PostConstruct
@@ -746,7 +749,14 @@ public class Maven2RepositoryStorage
             {
                 return false;
             }
+            // some files from remote repositories can have name like maven-metadata-archiva-vm-all-public.xml
+            else if ( StringUtils.startsWith( name, METADATA_FILENAME_START ) && StringUtils.endsWith( name, ".xml" ) )
+            {
+                return false;
+            }
+
             return true;
+
         }
     }