diff options
author | James William Dumay <jdumay@apache.org> | 2008-08-14 02:17:16 +0000 |
---|---|---|
committer | James William Dumay <jdumay@apache.org> | 2008-08-14 02:17:16 +0000 |
commit | c43c6b90a6ae58ee7d8bba16b5ca07ed580bd78d (patch) | |
tree | 2f7d640d9b16d676ca67686bdec145fde8b444c2 | |
parent | 384b971464f8febadd44ee4e232f8c8dee91a675 (diff) | |
download | archiva-c43c6b90a6ae58ee7d8bba16b5ca07ed580bd78d.tar.gz archiva-c43c6b90a6ae58ee7d8bba16b5ca07ed580bd78d.zip |
MRM-907 - Remove VersionedReference/ProjectReference/ArtifactReference from RepositoryProxyConnectors
* A few more null checks for good measure.
* Metadata should always be updated even if the file does not exist. (wsmoak will love this, no more having to touch files).
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@685748 13f79535-47bb-0310-9956-ffa450edef68
2 files changed, 21 insertions, 6 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java index 000c8c6c8..2c5da3ebf 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -320,7 +320,7 @@ public class DefaultRepositoryProxyConnectors metadataNeedsUpdating = true; } - if ( metadataNeedsUpdating ) + if ( metadataNeedsUpdating || !localFile.exists()) { try { diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java index ce29b991d..06e387416 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java @@ -439,7 +439,18 @@ public class MetadataTools metadata = RepositoryMetadataMerge.merge(metadata, proxiedMetadata); } - Set<String> availableVersions = new HashSet<String>(metadata.getAvailableVersions()); + if (metadata == null) + { + log.debug("No metadata to update for " + logicalResource); + return; + } + + Set<String> availableVersions = new HashSet<String>(); + List<String> metadataAvailableVersions = metadata.getAvailableVersions(); + if (metadataAvailableVersions != null) + { + availableVersions.addAll(metadataAvailableVersions); + } availableVersions = findPossibleVersions(availableVersions, metadataFile.getParentFile()); if (availableVersions.size() > 0) @@ -500,12 +511,16 @@ public class MetadataTools } } - for (String proxyId : proxies.get(managedRepository.getId())) + Set<String> proxyIds = proxies.get(managedRepository.getId()); + if (proxyIds != null) { - ArchivaRepositoryMetadata proxyMetadata = readProxyMetadata( managedRepository, logicalResource, proxyId ); - if (proxyMetadata != null) + for (String proxyId : proxyIds) { - metadatas.add(proxyMetadata); + ArchivaRepositoryMetadata proxyMetadata = readProxyMetadata( managedRepository, logicalResource, proxyId ); + if (proxyMetadata != null) + { + metadatas.add(proxyMetadata); + } } } |