From 9a1d22fa40a5c4f190716c11bea127308dad8b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 19 Jan 2013 08:56:12 +0100 Subject: [PATCH] move MAVEN_METADATA_XML constant to MavenMetadata class --- .../repository/internal/DefaultVersionRangeResolver.java | 5 +---- .../maven/repository/internal/DefaultVersionResolver.java | 6 ++---- .../org/apache/maven/repository/internal/MavenMetadata.java | 4 +++- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java index 26dca40be3..d2c87745ca 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java @@ -66,9 +66,6 @@ public class DefaultVersionRangeResolver implements VersionRangeResolver, Service { - private static final String MAVEN_METADATA_XML = "maven-metadata.xml"; - - @SuppressWarnings( "unused" ) @Requirement private Logger logger = NullLogger.INSTANCE; @@ -187,7 +184,7 @@ public class DefaultVersionRangeResolver Metadata metadata = new DefaultMetadata( request.getArtifact().getGroupId(), request.getArtifact().getArtifactId(), - MAVEN_METADATA_XML, Metadata.Nature.RELEASE_OR_SNAPSHOT ); + MavenMetadata.MAVEN_METADATA_XML, Metadata.Nature.RELEASE_OR_SNAPSHOT ); List metadataRequests = new ArrayList( request.getRepositories().size() ); diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java index daed903bbc..a9146d7fd7 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionResolver.java @@ -83,15 +83,12 @@ public class DefaultVersionResolver implements VersionResolver, Service { - private static final String MAVEN_METADATA_XML = "maven-metadata.xml"; - private static final String RELEASE = "RELEASE"; private static final String LATEST = "LATEST"; private static final String SNAPSHOT = "SNAPSHOT"; - @SuppressWarnings( "unused" ) @Requirement private Logger logger = NullLogger.INSTANCE; @@ -264,7 +261,8 @@ public class DefaultVersionResolver Artifact artifact = request.getArtifact(); Metadata metadata = - new DefaultMetadata( artifact.getGroupId(), artifact.getArtifactId(), version, MAVEN_METADATA_XML, nature ); + new DefaultMetadata( artifact.getGroupId(), artifact.getArtifactId(), version, + MavenMetadata.MAVEN_METADATA_XML, nature ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request ); diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java index 3db90e94fd..1fdfad7f82 100644 --- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java +++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenMetadata.java @@ -41,6 +41,8 @@ abstract class MavenMetadata implements MergeableMetadata { + static final String MAVEN_METADATA_XML = "maven-metadata.xml"; + private final File file; protected Metadata metadata; @@ -55,7 +57,7 @@ abstract class MavenMetadata public String getType() { - return "maven-metadata.xml"; + return MAVEN_METADATA_XML; } public File getFile()