maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r891200 - /maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java
Date Wed, 16 Dec 2009 11:33:42 GMT
Author: bentmann
Date: Wed Dec 16 11:33:42 2009
New Revision: 891200

URL: http://svn.apache.org/viewvc?rev=891200&view=rev
Log:
[MNG-4498] Don't fail dependency resolution if one remote repo's metadata is broken

Modified:
    maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java

Modified: maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java?rev=891200&r1=891199&r2=891200&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java
(original)
+++ maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java
Wed Dec 16 11:33:42 2009
@@ -164,10 +164,6 @@
         {
             throw new RepositoryMetadataResolutionException( "Unable to store local copy
of metadata: " + e.getMessage(), e );
         }
-        catch ( RepositoryMetadataReadException e )
-        {
-            throw new RepositoryMetadataResolutionException( "Unable to read local copy of
metadata: " + e.getMessage(), e );
-        }
 
         if ( cache != null )
         {
@@ -298,7 +294,7 @@
     }
 
     private void mergeMetadata( RepositoryMetadata metadata, List<ArtifactRepository>
remoteRepositories, ArtifactRepository localRepository )
-        throws RepositoryMetadataStoreException, RepositoryMetadataReadException
+        throws RepositoryMetadataStoreException
     {
         // TODO: currently this is first wins, but really we should take the latest by comparing
either the
         // snapshot timestamp, or some other timestamp later encoded into the metadata.
@@ -365,7 +361,6 @@
     }
 
     private boolean loadMetadata( RepositoryMetadata repoMetadata, ArtifactRepository remoteRepository,
ArtifactRepository localRepository, Map<ArtifactRepository, Metadata> previousMetadata
)
-        throws RepositoryMetadataReadException
     {
         boolean setRepository = false;
 
@@ -373,7 +368,24 @@
 
         if ( metadataFile.exists() )
         {
-            Metadata metadata = readMetadata( metadataFile );
+            Metadata metadata;
+
+            try
+            {
+                metadata = readMetadata( metadataFile );
+            }
+            catch ( RepositoryMetadataReadException e )
+            {
+                if ( getLogger().isDebugEnabled() )
+                {
+                    getLogger().warn( e.getMessage(), e );
+                }
+                else
+                {
+                    getLogger().warn( e.getMessage() );
+                }
+                return setRepository;
+            }
 
             if ( repoMetadata.isSnapshot() && ( previousMetadata != null ) )
             {



Mime
View raw message