Skip to content

Commit

Permalink
created MavenServiceLocator class to replace DefaultServiceLocator
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1139966 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
hboutemy committed Jun 26, 2011
1 parent 288c434 commit ef10c5c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 );
}

}

0 comments on commit ef10c5c

Please sign in to comment.