diff options
author | Brett Porter <brett@apache.org> | 2009-12-24 02:40:57 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2009-12-24 02:40:57 +0000 |
commit | 79de06cf3e28ff6e0bb6b917e2a6ddcd2cbeef4b (patch) | |
tree | e50da4037aad1ba41ef6936ccc440659ce09e5d4 /archiva-modules/metadata | |
parent | 9076b869b338749e4bec6e8cc89ca176cf079086 (diff) | |
download | archiva-79de06cf3e28ff6e0bb6b917e2a6ddcd2cbeef4b.tar.gz archiva-79de06cf3e28ff6e0bb6b917e2a6ddcd2cbeef4b.zip |
[MRM-1283] propagate errors occurring during resolution
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@893686 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata')
3 files changed, 44 insertions, 5 deletions
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java index fe54fe0ae..15fd9c485 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java @@ -62,6 +62,7 @@ public class DefaultMetadataResolver public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) + throws MetadataResolutionException { ProjectVersionMetadata metadata = metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion ); @@ -198,11 +199,19 @@ public class DefaultMetadataResolver } for ( String projectVersion : storageProjectVersions ) { - ProjectVersionMetadata versionMetadata = - storageResolver.getProjectVersion( repoId, namespace, projectId, projectVersion ); - if ( versionMetadata != null ) + try { - metadataRepository.updateProjectVersion( repoId, namespace, projectId, versionMetadata ); + ProjectVersionMetadata versionMetadata = + storageResolver.getProjectVersion( repoId, namespace, projectId, projectVersion ); + if ( versionMetadata != null ) + { + metadataRepository.updateProjectVersion( repoId, namespace, projectId, versionMetadata ); + } + } + catch ( MetadataResolutionException e ) + { + log.warn( "Not update project in metadata repository due to an error resolving it from storage: " + + e.getMessage() ); } } projectVersions = new ArrayList<String>( projectVersions ); diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolutionException.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolutionException.java new file mode 100644 index 000000000..57525e954 --- /dev/null +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolutionException.java @@ -0,0 +1,29 @@ +package org.apache.archiva.metadata.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +public class MetadataResolutionException + extends Exception +{ + public MetadataResolutionException( String message ) + { + super( message ); + } +} diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java index c6ca461af..c00f97cf9 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java @@ -31,7 +31,8 @@ public interface MetadataResolver ProjectMetadata getProject( String repoId, String namespace, String projectId ); ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, - String projectVersion ); + String projectVersion ) + throws MetadataResolutionException; Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion ); |