mirror of https://github.com/apache/maven.git
created MavenServiceLocator class to replace DefaultServiceLocator
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1139966 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
288c434532
commit
ef10c5c4bb
|
@ -31,6 +31,7 @@ import org.sonatype.aether.impl.VersionResolver;
|
|||
* should instead always use regular dependency injection to acquire the repository system.
|
||||
*
|
||||
* @author Benjamin Bentmann
|
||||
* @deprecated use {@link MavenServiceLocator} instead, which is more explicit.
|
||||
*/
|
||||
public class DefaultServiceLocator
|
||||
extends org.sonatype.aether.impl.internal.DefaultServiceLocator
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package org.apache.maven.repository.internal;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import org.sonatype.aether.impl.ArtifactDescriptorReader;
|
||||
import org.sonatype.aether.impl.internal.DefaultServiceLocator;
|
||||
import org.sonatype.aether.impl.MetadataGeneratorFactory;
|
||||
import org.sonatype.aether.impl.VersionRangeResolver;
|
||||
import org.sonatype.aether.impl.VersionResolver;
|
||||
|
||||
/**
|
||||
* A simple service locator that is already setup with all components from this library. To acquire a complete
|
||||
* repository system, clients need to add some repository connectors for remote transfers. <em>Note:</em> This component
|
||||
* is meant to assist those clients that employ the repository systems outside of an IoC container, Maven plugins
|
||||
* should instead always use regular dependency injection to acquire the repository system.
|
||||
*
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
public class MavenServiceLocator
|
||||
extends DefaultServiceLocator
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates a new service locator that already knows about all service implementations included in this library.
|
||||
*/
|
||||
public MavenServiceLocator()
|
||||
{
|
||||
addService( ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class );
|
||||
addService( VersionResolver.class, DefaultVersionResolver.class );
|
||||
addService( VersionRangeResolver.class, DefaultVersionRangeResolver.class );
|
||||
addService( MetadataGeneratorFactory.class, SnapshotMetadataGeneratorFactory.class );
|
||||
addService( MetadataGeneratorFactory.class, VersionsMetadataGeneratorFactory.class );
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue