move MAVEN_METADATA_XML constant to MavenMetadata class

This commit is contained in:
Hervé Boutemy 2013-01-19 08:56:12 +01:00
parent 66dc8c6ec1
commit 9a1d22fa40
3 changed files with 6 additions and 9 deletions

View File

@ -66,9 +66,6 @@ public class DefaultVersionRangeResolver
implements VersionRangeResolver, Service implements VersionRangeResolver, Service
{ {
private static final String MAVEN_METADATA_XML = "maven-metadata.xml";
@SuppressWarnings( "unused" )
@Requirement @Requirement
private Logger logger = NullLogger.INSTANCE; private Logger logger = NullLogger.INSTANCE;
@ -187,7 +184,7 @@ public class DefaultVersionRangeResolver
Metadata metadata = Metadata metadata =
new DefaultMetadata( request.getArtifact().getGroupId(), request.getArtifact().getArtifactId(), 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<MetadataRequest> metadataRequests = new ArrayList<MetadataRequest>( request.getRepositories().size() ); List<MetadataRequest> metadataRequests = new ArrayList<MetadataRequest>( request.getRepositories().size() );

View File

@ -83,15 +83,12 @@ public class DefaultVersionResolver
implements VersionResolver, Service implements VersionResolver, Service
{ {
private static final String MAVEN_METADATA_XML = "maven-metadata.xml";
private static final String RELEASE = "RELEASE"; private static final String RELEASE = "RELEASE";
private static final String LATEST = "LATEST"; private static final String LATEST = "LATEST";
private static final String SNAPSHOT = "SNAPSHOT"; private static final String SNAPSHOT = "SNAPSHOT";
@SuppressWarnings( "unused" )
@Requirement @Requirement
private Logger logger = NullLogger.INSTANCE; private Logger logger = NullLogger.INSTANCE;
@ -264,7 +261,8 @@ public class DefaultVersionResolver
Artifact artifact = request.getArtifact(); Artifact artifact = request.getArtifact();
Metadata metadata = 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 ); RequestTrace trace = DefaultRequestTrace.newChild( request.getTrace(), request );

View File

@ -41,6 +41,8 @@ abstract class MavenMetadata
implements MergeableMetadata implements MergeableMetadata
{ {
static final String MAVEN_METADATA_XML = "maven-metadata.xml";
private final File file; private final File file;
protected Metadata metadata; protected Metadata metadata;
@ -55,7 +57,7 @@ abstract class MavenMetadata
public String getType() public String getType()
{ {
return "maven-metadata.xml"; return MAVEN_METADATA_XML;
} }
public File getFile() public File getFile()