[MNG-7874] Use name constants instead of free string literals (#1229)

Maven Resolver Provider: get rid of name free string literals.

Forward port of bbd84c6c87

---

https://issues.apache.org/jira/browse/MNG-7874
This commit is contained in:
Tamas Cservenak 2023-09-08 16:15:43 +02:00
parent 1c050eee7b
commit 0ea8879eea
3 changed files with 9 additions and 3 deletions

View File

@ -30,9 +30,11 @@ import org.eclipse.aether.installation.InstallRequest;
/**
* Maven G level metadata generator factory.
*/
@Named("plugins")
@Named(PluginsMetadataGeneratorFactory.NAME)
@Singleton
public class PluginsMetadataGeneratorFactory implements MetadataGeneratorFactory {
public static final String NAME = "plugins";
@Override
public MetadataGenerator newInstance(RepositorySystemSession session, InstallRequest request) {
return new PluginsMetadataGenerator(session, request);

View File

@ -30,9 +30,11 @@ import org.eclipse.aether.installation.InstallRequest;
/**
* Maven GAV level metadata generator factory.
*/
@Named("snapshot")
@Named(SnapshotMetadataGeneratorFactory.NAME)
@Singleton
public class SnapshotMetadataGeneratorFactory implements MetadataGeneratorFactory {
public static final String NAME = "snapshot";
@Override
public MetadataGenerator newInstance(RepositorySystemSession session, InstallRequest request) {
return new LocalSnapshotMetadataGenerator(session, request);

View File

@ -30,9 +30,11 @@ import org.eclipse.aether.installation.InstallRequest;
/**
* Maven GA level metadata generator factory.
*/
@Named("versions")
@Named(VersionsMetadataGeneratorFactory.NAME)
@Singleton
public class VersionsMetadataGeneratorFactory implements MetadataGeneratorFactory {
public static final String NAME = "versions";
@Override
public MetadataGenerator newInstance(RepositorySystemSession session, InstallRequest request) {
return new VersionsMetadataGenerator(session, request);