maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject [36/53] [abbrv] [partial] maven-resolver git commit: [MNG-6007] renamed Aether to Maven Artifact Resolver
Date Sun, 15 Jan 2017 19:24:10 GMT
http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/3a1b8ae0/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java
----------------------------------------------------------------------
diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java
deleted file mode 100644
index 148bf4d..0000000
--- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java
+++ /dev/null
@@ -1,398 +0,0 @@
-package org.eclipse.aether.internal.impl;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.eclipse.aether.RepositoryCache;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.impl.RemoteRepositoryManager;
-import org.eclipse.aether.impl.UpdatePolicyAnalyzer;
-import org.eclipse.aether.repository.Authentication;
-import org.eclipse.aether.repository.AuthenticationSelector;
-import org.eclipse.aether.repository.MirrorSelector;
-import org.eclipse.aether.repository.Proxy;
-import org.eclipse.aether.repository.ProxySelector;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.repository.RepositoryPolicy;
-import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider;
-import org.eclipse.aether.spi.locator.Service;
-import org.eclipse.aether.spi.locator.ServiceLocator;
-import org.eclipse.aether.spi.log.Logger;
-import org.eclipse.aether.spi.log.LoggerFactory;
-import org.eclipse.aether.spi.log.NullLoggerFactory;
-import org.eclipse.aether.util.StringUtils;
-
-/**
- */
-@Named
-public class DefaultRemoteRepositoryManager
-    implements RemoteRepositoryManager, Service
-{
-
-    private static final class LoggedMirror
-    {
-
-        private final Object[] keys;
-
-        public LoggedMirror( RemoteRepository original, RemoteRepository mirror )
-        {
-            keys = new Object[] { mirror.getId(), mirror.getUrl(), original.getId(), original.getUrl() };
-        }
-
-        @Override
-        public boolean equals( Object obj )
-        {
-            if ( this == obj )
-            {
-                return true;
-            }
-            else if ( !( obj instanceof LoggedMirror ) )
-            {
-                return false;
-            }
-            LoggedMirror that = (LoggedMirror) obj;
-            return Arrays.equals( keys, that.keys );
-        }
-
-        @Override
-        public int hashCode()
-        {
-            return Arrays.hashCode( keys );
-        }
-
-    }
-
-    private Logger logger = NullLoggerFactory.LOGGER;
-
-    private UpdatePolicyAnalyzer updatePolicyAnalyzer;
-
-    private ChecksumPolicyProvider checksumPolicyProvider;
-
-    public DefaultRemoteRepositoryManager()
-    {
-        // enables default constructor
-    }
-
-    @Inject
-    DefaultRemoteRepositoryManager( UpdatePolicyAnalyzer updatePolicyAnalyzer,
-                                    ChecksumPolicyProvider checksumPolicyProvider, LoggerFactory loggerFactory )
-    {
-        setUpdatePolicyAnalyzer( updatePolicyAnalyzer );
-        setChecksumPolicyProvider( checksumPolicyProvider );
-        setLoggerFactory( loggerFactory );
-    }
-
-    public void initService( ServiceLocator locator )
-    {
-        setLoggerFactory( locator.getService( LoggerFactory.class ) );
-        setUpdatePolicyAnalyzer( locator.getService( UpdatePolicyAnalyzer.class ) );
-        setChecksumPolicyProvider( locator.getService( ChecksumPolicyProvider.class ) );
-    }
-
-    public DefaultRemoteRepositoryManager setLoggerFactory( LoggerFactory loggerFactory )
-    {
-        this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
-        return this;
-    }
-
-    public DefaultRemoteRepositoryManager setUpdatePolicyAnalyzer( UpdatePolicyAnalyzer updatePolicyAnalyzer )
-    {
-        if ( updatePolicyAnalyzer == null )
-        {
-            throw new IllegalArgumentException( "update policy analyzer has not been specified" );
-        }
-        this.updatePolicyAnalyzer = updatePolicyAnalyzer;
-        return this;
-    }
-
-    public DefaultRemoteRepositoryManager setChecksumPolicyProvider( ChecksumPolicyProvider checksumPolicyProvider )
-    {
-        if ( checksumPolicyProvider == null )
-        {
-            throw new IllegalArgumentException( "checksum policy provider has not been specified" );
-        }
-        this.checksumPolicyProvider = checksumPolicyProvider;
-        return this;
-    }
-
-    public List<RemoteRepository> aggregateRepositories( RepositorySystemSession session,
-                                                         List<RemoteRepository> dominantRepositories,
-                                                         List<RemoteRepository> recessiveRepositories,
-                                                         boolean recessiveIsRaw )
-    {
-        if ( recessiveRepositories.isEmpty() )
-        {
-            return dominantRepositories;
-        }
-
-        MirrorSelector mirrorSelector = session.getMirrorSelector();
-        AuthenticationSelector authSelector = session.getAuthenticationSelector();
-        ProxySelector proxySelector = session.getProxySelector();
-
-        List<RemoteRepository> result = new ArrayList<RemoteRepository>( dominantRepositories );
-
-        next: for ( RemoteRepository recessiveRepository : recessiveRepositories )
-        {
-            RemoteRepository repository = recessiveRepository;
-
-            if ( recessiveIsRaw )
-            {
-                RemoteRepository mirrorRepository = mirrorSelector.getMirror( recessiveRepository );
-
-                if ( mirrorRepository != null )
-                {
-                    logMirror( session, recessiveRepository, mirrorRepository );
-                    repository = mirrorRepository;
-                }
-            }
-
-            String key = getKey( repository );
-
-            for ( ListIterator<RemoteRepository> it = result.listIterator(); it.hasNext(); )
-            {
-                RemoteRepository dominantRepository = it.next();
-
-                if ( key.equals( getKey( dominantRepository ) ) )
-                {
-                    if ( !dominantRepository.getMirroredRepositories().isEmpty()
-                        && !repository.getMirroredRepositories().isEmpty() )
-                    {
-                        RemoteRepository mergedRepository = mergeMirrors( session, dominantRepository, repository );
-                        if ( mergedRepository != dominantRepository )
-                        {
-                            it.set( mergedRepository );
-                        }
-                    }
-
-                    continue next;
-                }
-            }
-
-            if ( recessiveIsRaw )
-            {
-                RemoteRepository.Builder builder = null;
-                Authentication auth = authSelector.getAuthentication( repository );
-                if ( auth != null )
-                {
-                    builder = new RemoteRepository.Builder( repository );
-                    builder.setAuthentication( auth );
-                }
-                Proxy proxy = proxySelector.getProxy( repository );
-                if ( proxy != null )
-                {
-                    if ( builder == null )
-                    {
-                        builder = new RemoteRepository.Builder( repository );
-                    }
-                    builder.setProxy( proxy );
-                }
-                if ( builder != null )
-                {
-                    repository = builder.build();
-                }
-            }
-
-            result.add( repository );
-        }
-
-        return result;
-    }
-
-    private void logMirror( RepositorySystemSession session, RemoteRepository original, RemoteRepository mirror )
-    {
-        if ( !logger.isDebugEnabled() )
-        {
-            return;
-        }
-        RepositoryCache cache = session.getCache();
-        if ( cache != null )
-        {
-            Object key = new LoggedMirror( original, mirror );
-            if ( cache.get( session, key ) != null )
-            {
-                return;
-            }
-            cache.put( session, key, Boolean.TRUE );
-        }
-        logger.debug( "Using mirror " + mirror.getId() + " (" + mirror.getUrl() + ") for " + original.getId() + " ("
-            + original.getUrl() + ")." );
-    }
-
-    private String getKey( RemoteRepository repository )
-    {
-        return repository.getId();
-    }
-
-    private RemoteRepository mergeMirrors( RepositorySystemSession session, RemoteRepository dominant,
-                                           RemoteRepository recessive )
-    {
-        RemoteRepository.Builder merged = null;
-        RepositoryPolicy releases = null, snapshots = null;
-
-        next: for ( RemoteRepository rec : recessive.getMirroredRepositories() )
-        {
-            String recKey = getKey( rec );
-
-            for ( RemoteRepository dom : dominant.getMirroredRepositories() )
-            {
-                if ( recKey.equals( getKey( dom ) ) )
-                {
-                    continue next;
-                }
-            }
-
-            if ( merged == null )
-            {
-                merged = new RemoteRepository.Builder( dominant );
-                releases = dominant.getPolicy( false );
-                snapshots = dominant.getPolicy( true );
-            }
-
-            releases = merge( session, releases, rec.getPolicy( false ), false );
-            snapshots = merge( session, snapshots, rec.getPolicy( true ), false );
-
-            merged.addMirroredRepository( rec );
-        }
-
-        if ( merged == null )
-        {
-            return dominant;
-        }
-        return merged.setReleasePolicy( releases ).setSnapshotPolicy( snapshots ).build();
-    }
-
-    public RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, boolean releases,
-                                       boolean snapshots )
-    {
-        RepositoryPolicy policy1 = releases ? repository.getPolicy( false ) : null;
-        RepositoryPolicy policy2 = snapshots ? repository.getPolicy( true ) : null;
-        RepositoryPolicy policy = merge( session, policy1, policy2, true );
-        return policy;
-    }
-
-    private RepositoryPolicy merge( RepositorySystemSession session, RepositoryPolicy policy1,
-                                    RepositoryPolicy policy2, boolean globalPolicy )
-    {
-        RepositoryPolicy policy;
-
-        if ( policy2 == null )
-        {
-            if ( globalPolicy )
-            {
-                policy = merge( policy1, session.getUpdatePolicy(), session.getChecksumPolicy() );
-            }
-            else
-            {
-                policy = policy1;
-            }
-        }
-        else if ( policy1 == null )
-        {
-            if ( globalPolicy )
-            {
-                policy = merge( policy2, session.getUpdatePolicy(), session.getChecksumPolicy() );
-            }
-            else
-            {
-                policy = policy2;
-            }
-        }
-        else if ( !policy2.isEnabled() )
-        {
-            if ( globalPolicy )
-            {
-                policy = merge( policy1, session.getUpdatePolicy(), session.getChecksumPolicy() );
-            }
-            else
-            {
-                policy = policy1;
-            }
-        }
-        else if ( !policy1.isEnabled() )
-        {
-            if ( globalPolicy )
-            {
-                policy = merge( policy2, session.getUpdatePolicy(), session.getChecksumPolicy() );
-            }
-            else
-            {
-                policy = policy2;
-            }
-        }
-        else
-        {
-            String checksums = session.getChecksumPolicy();
-            if ( globalPolicy && !StringUtils.isEmpty( checksums ) )
-            {
-                // use global override
-            }
-            else
-            {
-                checksums =
-                    checksumPolicyProvider.getEffectiveChecksumPolicy( session, policy1.getChecksumPolicy(),
-                                                                       policy2.getChecksumPolicy() );
-            }
-
-            String updates = session.getUpdatePolicy();
-            if ( globalPolicy && !StringUtils.isEmpty( updates ) )
-            {
-                // use global override
-            }
-            else
-            {
-                updates =
-                    updatePolicyAnalyzer.getEffectiveUpdatePolicy( session, policy1.getUpdatePolicy(),
-                                                                   policy2.getUpdatePolicy() );
-            }
-
-            policy = new RepositoryPolicy( true, updates, checksums );
-        }
-
-        return policy;
-    }
-
-    private RepositoryPolicy merge( RepositoryPolicy policy, String updates, String checksums )
-    {
-        if ( policy != null )
-        {
-            if ( StringUtils.isEmpty( updates ) )
-            {
-                updates = policy.getUpdatePolicy();
-            }
-            if ( StringUtils.isEmpty( checksums ) )
-            {
-                checksums = policy.getChecksumPolicy();
-            }
-            if ( !policy.getUpdatePolicy().equals( updates ) || !policy.getChecksumPolicy().equals( checksums ) )
-            {
-                policy = new RepositoryPolicy( policy.isEnabled(), updates, checksums );
-            }
-        }
-        return policy;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/3a1b8ae0/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java
----------------------------------------------------------------------
diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java
deleted file mode 100644
index 10fdc23..0000000
--- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package org.eclipse.aether.internal.impl;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.impl.RepositoryConnectorProvider;
-import org.eclipse.aether.repository.Authentication;
-import org.eclipse.aether.repository.Proxy;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.spi.connector.RepositoryConnector;
-import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
-import org.eclipse.aether.spi.locator.Service;
-import org.eclipse.aether.spi.locator.ServiceLocator;
-import org.eclipse.aether.spi.log.Logger;
-import org.eclipse.aether.spi.log.LoggerFactory;
-import org.eclipse.aether.spi.log.NullLoggerFactory;
-import org.eclipse.aether.transfer.NoRepositoryConnectorException;
-
-/**
- */
-@Named
-public class DefaultRepositoryConnectorProvider
-    implements RepositoryConnectorProvider, Service
-{
-
-    private Logger logger = NullLoggerFactory.LOGGER;
-
-    private Collection<RepositoryConnectorFactory> connectorFactories = new ArrayList<RepositoryConnectorFactory>();
-
-    public DefaultRepositoryConnectorProvider()
-    {
-        // enables default constructor
-    }
-
-    @Inject
-    DefaultRepositoryConnectorProvider( Set<RepositoryConnectorFactory> connectorFactories, LoggerFactory loggerFactory )
-    {
-        setRepositoryConnectorFactories( connectorFactories );
-        setLoggerFactory( loggerFactory );
-    }
-
-    public void initService( ServiceLocator locator )
-    {
-        setLoggerFactory( locator.getService( LoggerFactory.class ) );
-        connectorFactories = locator.getServices( RepositoryConnectorFactory.class );
-    }
-
-    public DefaultRepositoryConnectorProvider setLoggerFactory( LoggerFactory loggerFactory )
-    {
-        this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
-        return this;
-    }
-
-    public DefaultRepositoryConnectorProvider addRepositoryConnectorFactory( RepositoryConnectorFactory factory )
-    {
-        if ( factory == null )
-        {
-            throw new IllegalArgumentException( "repository connector factory has not been specified" );
-        }
-        connectorFactories.add( factory );
-        return this;
-    }
-
-    public DefaultRepositoryConnectorProvider setRepositoryConnectorFactories( Collection<RepositoryConnectorFactory> factories )
-    {
-        if ( factories == null )
-        {
-            this.connectorFactories = new ArrayList<RepositoryConnectorFactory>();
-        }
-        else
-        {
-            this.connectorFactories = factories;
-        }
-        return this;
-    }
-
-    public RepositoryConnector newRepositoryConnector( RepositorySystemSession session, RemoteRepository repository )
-        throws NoRepositoryConnectorException
-    {
-        if ( repository == null )
-        {
-            throw new IllegalArgumentException( "remote repository has not been specified" );
-        }
-
-        PrioritizedComponents<RepositoryConnectorFactory> factories =
-            new PrioritizedComponents<RepositoryConnectorFactory>( session );
-        for ( RepositoryConnectorFactory factory : this.connectorFactories )
-        {
-            factories.add( factory, factory.getPriority() );
-        }
-
-        List<NoRepositoryConnectorException> errors = new ArrayList<NoRepositoryConnectorException>();
-        for ( PrioritizedComponent<RepositoryConnectorFactory> factory : factories.getEnabled() )
-        {
-            try
-            {
-                RepositoryConnector connector = factory.getComponent().newInstance( session, repository );
-
-                if ( logger.isDebugEnabled() )
-                {
-                    StringBuilder buffer = new StringBuilder( 256 );
-                    buffer.append( "Using connector " ).append( connector.getClass().getSimpleName() );
-                    Utils.appendClassLoader( buffer, connector );
-                    buffer.append( " with priority " ).append( factory.getPriority() );
-                    buffer.append( " for " ).append( repository.getUrl() );
-
-                    Authentication auth = repository.getAuthentication();
-                    if ( auth != null )
-                    {
-                        buffer.append( " with " ).append( auth );
-                    }
-
-                    Proxy proxy = repository.getProxy();
-                    if ( proxy != null )
-                    {
-                        buffer.append( " via " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() );
-
-                        auth = proxy.getAuthentication();
-                        if ( auth != null )
-                        {
-                            buffer.append( " with " ).append( auth );
-                        }
-                    }
-
-                    logger.debug( buffer.toString() );
-                }
-
-                return connector;
-            }
-            catch ( NoRepositoryConnectorException e )
-            {
-                // continue and try next factory
-                errors.add( e );
-            }
-        }
-        if ( logger.isDebugEnabled() && errors.size() > 1 )
-        {
-            String msg = "Could not obtain connector factory for " + repository;
-            for ( Exception e : errors )
-            {
-                logger.debug( msg, e );
-            }
-        }
-
-        StringBuilder buffer = new StringBuilder( 256 );
-        if ( factories.isEmpty() )
-        {
-            buffer.append( "No connector factories available" );
-        }
-        else
-        {
-            buffer.append( "Cannot access " ).append( repository.getUrl() );
-            buffer.append( " with type " ).append( repository.getContentType() );
-            buffer.append( " using the available connector factories: " );
-            factories.list( buffer );
-        }
-
-        throw new NoRepositoryConnectorException( repository, buffer.toString(), errors.size() == 1 ? errors.get( 0 )
-                        : null );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/3a1b8ae0/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java
----------------------------------------------------------------------
diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java
deleted file mode 100644
index 2e56c93..0000000
--- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package org.eclipse.aether.internal.impl;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.eclipse.aether.RepositoryEvent;
-import org.eclipse.aether.RepositoryListener;
-import org.eclipse.aether.impl.RepositoryEventDispatcher;
-import org.eclipse.aether.spi.locator.Service;
-import org.eclipse.aether.spi.locator.ServiceLocator;
-import org.eclipse.aether.spi.log.Logger;
-import org.eclipse.aether.spi.log.LoggerFactory;
-import org.eclipse.aether.spi.log.NullLoggerFactory;
-
-/**
- */
-@Named
-public class DefaultRepositoryEventDispatcher
-    implements RepositoryEventDispatcher, Service
-{
-
-    private Logger logger = NullLoggerFactory.LOGGER;
-
-    private Collection<RepositoryListener> listeners = new ArrayList<RepositoryListener>();
-
-    public DefaultRepositoryEventDispatcher()
-    {
-        // enables no-arg constructor
-    }
-
-    @Inject
-    DefaultRepositoryEventDispatcher( Set<RepositoryListener> listeners, LoggerFactory loggerFactory )
-    {
-        setRepositoryListeners( listeners );
-        setLoggerFactory( loggerFactory );
-    }
-
-    public DefaultRepositoryEventDispatcher setLoggerFactory( LoggerFactory loggerFactory )
-    {
-        this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
-        return this;
-    }
-
-    public DefaultRepositoryEventDispatcher addRepositoryListener( RepositoryListener listener )
-    {
-        if ( listener == null )
-        {
-            throw new IllegalArgumentException( "repository listener has not been specified" );
-        }
-        this.listeners.add( listener );
-        return this;
-    }
-
-    public DefaultRepositoryEventDispatcher setRepositoryListeners( Collection<RepositoryListener> listeners )
-    {
-        if ( listeners == null )
-        {
-            this.listeners = new ArrayList<RepositoryListener>();
-        }
-        else
-        {
-            this.listeners = listeners;
-        }
-        return this;
-    }
-
-    public void initService( ServiceLocator locator )
-    {
-        setLoggerFactory( locator.getService( LoggerFactory.class ) );
-        setRepositoryListeners( locator.getServices( RepositoryListener.class ) );
-    }
-
-    public void dispatch( RepositoryEvent event )
-    {
-        if ( !listeners.isEmpty() )
-        {
-            for ( RepositoryListener listener : listeners )
-            {
-                dispatch( event, listener );
-            }
-        }
-
-        RepositoryListener listener = event.getSession().getRepositoryListener();
-
-        if ( listener != null )
-        {
-            dispatch( event, listener );
-        }
-    }
-
-    private void dispatch( RepositoryEvent event, RepositoryListener listener )
-    {
-        try
-        {
-            switch ( event.getType() )
-            {
-                case ARTIFACT_DEPLOYED:
-                    listener.artifactDeployed( event );
-                    break;
-                case ARTIFACT_DEPLOYING:
-                    listener.artifactDeploying( event );
-                    break;
-                case ARTIFACT_DESCRIPTOR_INVALID:
-                    listener.artifactDescriptorInvalid( event );
-                    break;
-                case ARTIFACT_DESCRIPTOR_MISSING:
-                    listener.artifactDescriptorMissing( event );
-                    break;
-                case ARTIFACT_DOWNLOADED:
-                    listener.artifactDownloaded( event );
-                    break;
-                case ARTIFACT_DOWNLOADING:
-                    listener.artifactDownloading( event );
-                    break;
-                case ARTIFACT_INSTALLED:
-                    listener.artifactInstalled( event );
-                    break;
-                case ARTIFACT_INSTALLING:
-                    listener.artifactInstalling( event );
-                    break;
-                case ARTIFACT_RESOLVED:
-                    listener.artifactResolved( event );
-                    break;
-                case ARTIFACT_RESOLVING:
-                    listener.artifactResolving( event );
-                    break;
-                case METADATA_DEPLOYED:
-                    listener.metadataDeployed( event );
-                    break;
-                case METADATA_DEPLOYING:
-                    listener.metadataDeploying( event );
-                    break;
-                case METADATA_DOWNLOADED:
-                    listener.metadataDownloaded( event );
-                    break;
-                case METADATA_DOWNLOADING:
-                    listener.metadataDownloading( event );
-                    break;
-                case METADATA_INSTALLED:
-                    listener.metadataInstalled( event );
-                    break;
-                case METADATA_INSTALLING:
-                    listener.metadataInstalling( event );
-                    break;
-                case METADATA_INVALID:
-                    listener.metadataInvalid( event );
-                    break;
-                case METADATA_RESOLVED:
-                    listener.metadataResolved( event );
-                    break;
-                case METADATA_RESOLVING:
-                    listener.metadataResolving( event );
-                    break;
-                default:
-                    throw new IllegalStateException( "unknown repository event type " + event.getType() );
-            }
-        }
-        catch ( Exception e )
-        {
-            logError( e, listener );
-        }
-        catch ( LinkageError e )
-        {
-            logError( e, listener );
-        }
-    }
-
-    private void logError( Throwable e, Object listener )
-    {
-        String msg =
-            "Failed to dispatch repository event to " + listener.getClass().getCanonicalName() + ": " + e.getMessage();
-
-        if ( logger.isDebugEnabled() )
-        {
-            logger.warn( msg, e );
-        }
-        else
-        {
-            logger.warn( msg );
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/3a1b8ae0/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java
----------------------------------------------------------------------
diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java
deleted file mode 100644
index 9cc6371..0000000
--- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package org.eclipse.aether.internal.impl;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.spi.connector.layout.RepositoryLayout;
-import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory;
-import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider;
-import org.eclipse.aether.spi.locator.Service;
-import org.eclipse.aether.spi.locator.ServiceLocator;
-import org.eclipse.aether.spi.log.Logger;
-import org.eclipse.aether.spi.log.LoggerFactory;
-import org.eclipse.aether.spi.log.NullLoggerFactory;
-import org.eclipse.aether.transfer.NoRepositoryLayoutException;
-
-/**
- */
-@Named
-public final class DefaultRepositoryLayoutProvider
-    implements RepositoryLayoutProvider, Service
-{
-
-    private Logger logger = NullLoggerFactory.LOGGER;
-
-    private Collection<RepositoryLayoutFactory> factories = new ArrayList<RepositoryLayoutFactory>();
-
-    public DefaultRepositoryLayoutProvider()
-    {
-        // enables default constructor
-    }
-
-    @Inject
-    DefaultRepositoryLayoutProvider( Set<RepositoryLayoutFactory> layoutFactories, LoggerFactory loggerFactory )
-    {
-        setLoggerFactory( loggerFactory );
-        setRepositoryLayoutFactories( layoutFactories );
-    }
-
-    public void initService( ServiceLocator locator )
-    {
-        setLoggerFactory( locator.getService( LoggerFactory.class ) );
-        setRepositoryLayoutFactories( locator.getServices( RepositoryLayoutFactory.class ) );
-    }
-
-    public DefaultRepositoryLayoutProvider setLoggerFactory( LoggerFactory loggerFactory )
-    {
-        this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
-        return this;
-    }
-
-    public DefaultRepositoryLayoutProvider addRepositoryLayoutFactory( RepositoryLayoutFactory factory )
-    {
-        if ( factory == null )
-        {
-            throw new IllegalArgumentException( "layout factory has not been specified" );
-        }
-        factories.add( factory );
-        return this;
-    }
-
-    public DefaultRepositoryLayoutProvider setRepositoryLayoutFactories( Collection<RepositoryLayoutFactory> factories )
-    {
-        if ( factories == null )
-        {
-            this.factories = new ArrayList<RepositoryLayoutFactory>();
-        }
-        else
-        {
-            this.factories = factories;
-        }
-        return this;
-    }
-
-    public RepositoryLayout newRepositoryLayout( RepositorySystemSession session, RemoteRepository repository )
-        throws NoRepositoryLayoutException
-    {
-        if ( repository == null )
-        {
-            throw new IllegalArgumentException( "remote repository has not been specified" );
-        }
-
-        PrioritizedComponents<RepositoryLayoutFactory> factories =
-            new PrioritizedComponents<RepositoryLayoutFactory>( session );
-        for ( RepositoryLayoutFactory factory : this.factories )
-        {
-            factories.add( factory, factory.getPriority() );
-        }
-
-        List<NoRepositoryLayoutException> errors = new ArrayList<NoRepositoryLayoutException>();
-        for ( PrioritizedComponent<RepositoryLayoutFactory> factory : factories.getEnabled() )
-        {
-            try
-            {
-                RepositoryLayout layout = factory.getComponent().newInstance( session, repository );
-                return layout;
-            }
-            catch ( NoRepositoryLayoutException e )
-            {
-                // continue and try next factory
-                errors.add( e );
-            }
-        }
-        if ( logger.isDebugEnabled() && errors.size() > 1 )
-        {
-            String msg = "Could not obtain layout factory for " + repository;
-            for ( Exception e : errors )
-            {
-                logger.debug( msg, e );
-            }
-        }
-
-        StringBuilder buffer = new StringBuilder( 256 );
-        if ( factories.isEmpty() )
-        {
-            buffer.append( "No layout factories registered" );
-        }
-        else
-        {
-            buffer.append( "Cannot access " ).append( repository.getUrl() );
-            buffer.append( " with type " ).append( repository.getContentType() );
-            buffer.append( " using the available layout factories: " );
-            factories.list( buffer );
-        }
-
-        throw new NoRepositoryLayoutException( repository, buffer.toString(), errors.size() == 1 ? errors.get( 0 )
-                        : null );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/3a1b8ae0/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java
----------------------------------------------------------------------
diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java
deleted file mode 100644
index 06faaf7..0000000
--- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java
+++ /dev/null
@@ -1,514 +0,0 @@
-package org.eclipse.aether.internal.impl;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.RequestTrace;
-import org.eclipse.aether.SyncContext;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.collection.CollectRequest;
-import org.eclipse.aether.collection.CollectResult;
-import org.eclipse.aether.collection.DependencyCollectionException;
-import org.eclipse.aether.deployment.DeployRequest;
-import org.eclipse.aether.deployment.DeployResult;
-import org.eclipse.aether.deployment.DeploymentException;
-import org.eclipse.aether.graph.DependencyFilter;
-import org.eclipse.aether.graph.DependencyVisitor;
-import org.eclipse.aether.impl.ArtifactDescriptorReader;
-import org.eclipse.aether.impl.ArtifactResolver;
-import org.eclipse.aether.impl.DependencyCollector;
-import org.eclipse.aether.impl.Deployer;
-import org.eclipse.aether.impl.Installer;
-import org.eclipse.aether.impl.LocalRepositoryProvider;
-import org.eclipse.aether.impl.MetadataResolver;
-import org.eclipse.aether.impl.RemoteRepositoryManager;
-import org.eclipse.aether.impl.SyncContextFactory;
-import org.eclipse.aether.impl.VersionRangeResolver;
-import org.eclipse.aether.impl.VersionResolver;
-import org.eclipse.aether.installation.InstallRequest;
-import org.eclipse.aether.installation.InstallResult;
-import org.eclipse.aether.installation.InstallationException;
-import org.eclipse.aether.repository.Authentication;
-import org.eclipse.aether.repository.LocalRepository;
-import org.eclipse.aether.repository.LocalRepositoryManager;
-import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
-import org.eclipse.aether.repository.Proxy;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.ArtifactDescriptorException;
-import org.eclipse.aether.resolution.ArtifactDescriptorRequest;
-import org.eclipse.aether.resolution.ArtifactDescriptorResult;
-import org.eclipse.aether.resolution.ArtifactRequest;
-import org.eclipse.aether.resolution.ArtifactResolutionException;
-import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.resolution.DependencyRequest;
-import org.eclipse.aether.resolution.DependencyResolutionException;
-import org.eclipse.aether.resolution.DependencyResult;
-import org.eclipse.aether.resolution.MetadataRequest;
-import org.eclipse.aether.resolution.MetadataResult;
-import org.eclipse.aether.resolution.VersionRangeRequest;
-import org.eclipse.aether.resolution.VersionRangeResolutionException;
-import org.eclipse.aether.resolution.VersionRangeResult;
-import org.eclipse.aether.resolution.VersionRequest;
-import org.eclipse.aether.resolution.VersionResolutionException;
-import org.eclipse.aether.resolution.VersionResult;
-import org.eclipse.aether.spi.locator.Service;
-import org.eclipse.aether.spi.locator.ServiceLocator;
-import org.eclipse.aether.spi.log.Logger;
-import org.eclipse.aether.spi.log.LoggerFactory;
-import org.eclipse.aether.spi.log.NullLoggerFactory;
-import org.eclipse.aether.util.graph.visitor.FilteringDependencyVisitor;
-import org.eclipse.aether.util.graph.visitor.TreeDependencyVisitor;
-
-/**
- */
-@Named
-public class DefaultRepositorySystem
-    implements RepositorySystem, Service
-{
-
-    private Logger logger = NullLoggerFactory.LOGGER;
-
-    private VersionResolver versionResolver;
-
-    private VersionRangeResolver versionRangeResolver;
-
-    private ArtifactResolver artifactResolver;
-
-    private MetadataResolver metadataResolver;
-
-    private ArtifactDescriptorReader artifactDescriptorReader;
-
-    private DependencyCollector dependencyCollector;
-
-    private Installer installer;
-
-    private Deployer deployer;
-
-    private LocalRepositoryProvider localRepositoryProvider;
-
-    private SyncContextFactory syncContextFactory;
-
-    private RemoteRepositoryManager remoteRepositoryManager;
-
-    public DefaultRepositorySystem()
-    {
-        // enables default constructor
-    }
-
-    @Inject
-    DefaultRepositorySystem( VersionResolver versionResolver, VersionRangeResolver versionRangeResolver,
-                             ArtifactResolver artifactResolver, MetadataResolver metadataResolver,
-                             ArtifactDescriptorReader artifactDescriptorReader,
-                             DependencyCollector dependencyCollector, Installer installer, Deployer deployer,
-                             LocalRepositoryProvider localRepositoryProvider, SyncContextFactory syncContextFactory,
-                             RemoteRepositoryManager remoteRepositoryManager, LoggerFactory loggerFactory )
-    {
-        setVersionResolver( versionResolver );
-        setVersionRangeResolver( versionRangeResolver );
-        setArtifactResolver( artifactResolver );
-        setMetadataResolver( metadataResolver );
-        setArtifactDescriptorReader( artifactDescriptorReader );
-        setDependencyCollector( dependencyCollector );
-        setInstaller( installer );
-        setDeployer( deployer );
-        setLocalRepositoryProvider( localRepositoryProvider );
-        setSyncContextFactory( syncContextFactory );
-        setRemoteRepositoryManager( remoteRepositoryManager );
-        setLoggerFactory( loggerFactory );
-    }
-
-    public void initService( ServiceLocator locator )
-    {
-        setLoggerFactory( locator.getService( LoggerFactory.class ) );
-        setVersionResolver( locator.getService( VersionResolver.class ) );
-        setVersionRangeResolver( locator.getService( VersionRangeResolver.class ) );
-        setArtifactResolver( locator.getService( ArtifactResolver.class ) );
-        setMetadataResolver( locator.getService( MetadataResolver.class ) );
-        setArtifactDescriptorReader( locator.getService( ArtifactDescriptorReader.class ) );
-        setDependencyCollector( locator.getService( DependencyCollector.class ) );
-        setInstaller( locator.getService( Installer.class ) );
-        setDeployer( locator.getService( Deployer.class ) );
-        setLocalRepositoryProvider( locator.getService( LocalRepositoryProvider.class ) );
-        setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) );
-        setSyncContextFactory( locator.getService( SyncContextFactory.class ) );
-    }
-
-    public DefaultRepositorySystem setLoggerFactory( LoggerFactory loggerFactory )
-    {
-        this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
-        return this;
-    }
-
-    public DefaultRepositorySystem setVersionResolver( VersionResolver versionResolver )
-    {
-        if ( versionResolver == null )
-        {
-            throw new IllegalArgumentException( "version resolver has not been specified" );
-        }
-        this.versionResolver = versionResolver;
-        return this;
-    }
-
-    public DefaultRepositorySystem setVersionRangeResolver( VersionRangeResolver versionRangeResolver )
-    {
-        if ( versionRangeResolver == null )
-        {
-            throw new IllegalArgumentException( "version range resolver has not been specified" );
-        }
-        this.versionRangeResolver = versionRangeResolver;
-        return this;
-    }
-
-    public DefaultRepositorySystem setArtifactResolver( ArtifactResolver artifactResolver )
-    {
-        if ( artifactResolver == null )
-        {
-            throw new IllegalArgumentException( "artifact resolver has not been specified" );
-        }
-        this.artifactResolver = artifactResolver;
-        return this;
-    }
-
-    public DefaultRepositorySystem setMetadataResolver( MetadataResolver metadataResolver )
-    {
-        if ( metadataResolver == null )
-        {
-            throw new IllegalArgumentException( "metadata resolver has not been specified" );
-        }
-        this.metadataResolver = metadataResolver;
-        return this;
-    }
-
-    public DefaultRepositorySystem setArtifactDescriptorReader( ArtifactDescriptorReader artifactDescriptorReader )
-    {
-        if ( artifactDescriptorReader == null )
-        {
-            throw new IllegalArgumentException( "artifact descriptor reader has not been specified" );
-        }
-        this.artifactDescriptorReader = artifactDescriptorReader;
-        return this;
-    }
-
-    public DefaultRepositorySystem setDependencyCollector( DependencyCollector dependencyCollector )
-    {
-        if ( dependencyCollector == null )
-        {
-            throw new IllegalArgumentException( "dependency collector has not been specified" );
-        }
-        this.dependencyCollector = dependencyCollector;
-        return this;
-    }
-
-    public DefaultRepositorySystem setInstaller( Installer installer )
-    {
-        if ( installer == null )
-        {
-            throw new IllegalArgumentException( "installer has not been specified" );
-        }
-        this.installer = installer;
-        return this;
-    }
-
-    public DefaultRepositorySystem setDeployer( Deployer deployer )
-    {
-        if ( deployer == null )
-        {
-            throw new IllegalArgumentException( "deployer has not been specified" );
-        }
-        this.deployer = deployer;
-        return this;
-    }
-
-    public DefaultRepositorySystem setLocalRepositoryProvider( LocalRepositoryProvider localRepositoryProvider )
-    {
-        if ( localRepositoryProvider == null )
-        {
-            throw new IllegalArgumentException( "local repository provider has not been specified" );
-        }
-        this.localRepositoryProvider = localRepositoryProvider;
-        return this;
-    }
-
-    public DefaultRepositorySystem setSyncContextFactory( SyncContextFactory syncContextFactory )
-    {
-        if ( syncContextFactory == null )
-        {
-            throw new IllegalArgumentException( "sync context factory has not been specified" );
-        }
-        this.syncContextFactory = syncContextFactory;
-        return this;
-    }
-
-    public DefaultRepositorySystem setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager )
-    {
-        if ( remoteRepositoryManager == null )
-        {
-            throw new IllegalArgumentException( "remote repository manager has not been specified" );
-        }
-        this.remoteRepositoryManager = remoteRepositoryManager;
-        return this;
-    }
-
-    public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request )
-        throws VersionResolutionException
-    {
-        validateSession( session );
-        return versionResolver.resolveVersion( session, request );
-    }
-
-    public VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request )
-        throws VersionRangeResolutionException
-    {
-        validateSession( session );
-        return versionRangeResolver.resolveVersionRange( session, request );
-    }
-
-    public ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session,
-                                                            ArtifactDescriptorRequest request )
-        throws ArtifactDescriptorException
-    {
-        validateSession( session );
-        return artifactDescriptorReader.readArtifactDescriptor( session, request );
-    }
-
-    public ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request )
-        throws ArtifactResolutionException
-    {
-        validateSession( session );
-        return artifactResolver.resolveArtifact( session, request );
-    }
-
-    public List<ArtifactResult> resolveArtifacts( RepositorySystemSession session,
-                                                  Collection<? extends ArtifactRequest> requests )
-        throws ArtifactResolutionException
-    {
-        validateSession( session );
-        return artifactResolver.resolveArtifacts( session, requests );
-    }
-
-    public List<MetadataResult> resolveMetadata( RepositorySystemSession session,
-                                                 Collection<? extends MetadataRequest> requests )
-    {
-        validateSession( session );
-        return metadataResolver.resolveMetadata( session, requests );
-    }
-
-    public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request )
-        throws DependencyCollectionException
-    {
-        validateSession( session );
-        return dependencyCollector.collectDependencies( session, request );
-    }
-
-    public DependencyResult resolveDependencies( RepositorySystemSession session, DependencyRequest request )
-        throws DependencyResolutionException
-    {
-        validateSession( session );
-
-        RequestTrace trace = RequestTrace.newChild( request.getTrace(), request );
-
-        DependencyResult result = new DependencyResult( request );
-
-        DependencyCollectionException dce = null;
-        ArtifactResolutionException are = null;
-
-        if ( request.getRoot() != null )
-        {
-            result.setRoot( request.getRoot() );
-        }
-        else if ( request.getCollectRequest() != null )
-        {
-            CollectResult collectResult;
-            try
-            {
-                request.getCollectRequest().setTrace( trace );
-                collectResult = dependencyCollector.collectDependencies( session, request.getCollectRequest() );
-            }
-            catch ( DependencyCollectionException e )
-            {
-                dce = e;
-                collectResult = e.getResult();
-            }
-            result.setRoot( collectResult.getRoot() );
-            result.setCycles( collectResult.getCycles() );
-            result.setCollectExceptions( collectResult.getExceptions() );
-        }
-        else
-        {
-            throw new IllegalArgumentException( "dependency node or collect request missing" );
-        }
-
-        ArtifactRequestBuilder builder = new ArtifactRequestBuilder( trace );
-        DependencyFilter filter = request.getFilter();
-        DependencyVisitor visitor = ( filter != null ) ? new FilteringDependencyVisitor( builder, filter ) : builder;
-        visitor = new TreeDependencyVisitor( visitor );
-        result.getRoot().accept( visitor );
-        List<ArtifactRequest> requests = builder.getRequests();
-
-        List<ArtifactResult> results;
-        try
-        {
-            results = artifactResolver.resolveArtifacts( session, requests );
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            are = e;
-            results = e.getResults();
-        }
-        result.setArtifactResults( results );
-
-        updateNodesWithResolvedArtifacts( results );
-
-        if ( dce != null )
-        {
-            throw new DependencyResolutionException( result, dce );
-        }
-        else if ( are != null )
-        {
-            throw new DependencyResolutionException( result, are );
-        }
-
-        return result;
-    }
-
-    private void updateNodesWithResolvedArtifacts( List<ArtifactResult> results )
-    {
-        for ( ArtifactResult result : results )
-        {
-            Artifact artifact = result.getArtifact();
-            if ( artifact != null )
-            {
-                result.getRequest().getDependencyNode().setArtifact( artifact );
-            }
-        }
-    }
-
-    public InstallResult install( RepositorySystemSession session, InstallRequest request )
-        throws InstallationException
-    {
-        validateSession( session );
-        return installer.install( session, request );
-    }
-
-    public DeployResult deploy( RepositorySystemSession session, DeployRequest request )
-        throws DeploymentException
-    {
-        validateSession( session );
-        return deployer.deploy( session, request );
-    }
-
-    public LocalRepositoryManager newLocalRepositoryManager( RepositorySystemSession session,
-                                                             LocalRepository localRepository )
-    {
-        try
-        {
-            return localRepositoryProvider.newLocalRepositoryManager( session, localRepository );
-        }
-        catch ( NoLocalRepositoryManagerException e )
-        {
-            throw new IllegalArgumentException( e.getMessage(), e );
-        }
-    }
-
-    public SyncContext newSyncContext( RepositorySystemSession session, boolean shared )
-    {
-        validateSession( session );
-        return syncContextFactory.newInstance( session, shared );
-    }
-
-    public List<RemoteRepository> newResolutionRepositories( RepositorySystemSession session,
-                                                             List<RemoteRepository> repositories )
-    {
-        validateSession( session );
-        repositories =
-            remoteRepositoryManager.aggregateRepositories( session, new ArrayList<RemoteRepository>(), repositories,
-                                                           true );
-        return repositories;
-    }
-
-    public RemoteRepository newDeploymentRepository( RepositorySystemSession session, RemoteRepository repository )
-    {
-        validateSession( session );
-        RemoteRepository.Builder builder = new RemoteRepository.Builder( repository );
-        Authentication auth = session.getAuthenticationSelector().getAuthentication( repository );
-        builder.setAuthentication( auth );
-        Proxy proxy = session.getProxySelector().getProxy( repository );
-        builder.setProxy( proxy );
-        return builder.build();
-    }
-
-    private void validateSession( RepositorySystemSession session )
-    {
-        if ( session == null )
-        {
-            throw new IllegalArgumentException( "Invalid repository system session: the session may not be null." );
-        }
-        if ( session.getLocalRepositoryManager() == null )
-        {
-            invalidSession( "LocalRepositoryManager" );
-        }
-        if ( session.getSystemProperties() == null )
-        {
-            invalidSession( "SystemProperties" );
-        }
-        if ( session.getUserProperties() == null )
-        {
-            invalidSession( "UserProperties" );
-        }
-        if ( session.getConfigProperties() == null )
-        {
-            invalidSession( "ConfigProperties" );
-        }
-        if ( session.getMirrorSelector() == null )
-        {
-            invalidSession( "MirrorSelector" );
-        }
-        if ( session.getProxySelector() == null )
-        {
-            invalidSession( "ProxySelector" );
-        }
-        if ( session.getAuthenticationSelector() == null )
-        {
-            invalidSession( "AuthenticationSelector" );
-        }
-        if ( session.getArtifactTypeRegistry() == null )
-        {
-            invalidSession( "ArtifactTypeRegistry" );
-        }
-        if ( session.getData() == null )
-        {
-            invalidSession( "Data" );
-        }
-    }
-
-    private void invalidSession( String name )
-    {
-        throw new IllegalArgumentException( "Invalid repository system session: " + name + " is not set." );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/3a1b8ae0/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java
----------------------------------------------------------------------
diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java
deleted file mode 100644
index 69fdbc6..0000000
--- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.aether.internal.impl;
-
-/*
- * 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 java.util.Collection;
-
-import javax.inject.Named;
-
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.SyncContext;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.impl.SyncContextFactory;
-import org.eclipse.aether.metadata.Metadata;
-
-/**
- * A factory to create synchronization contexts. This default implementation actually does not provide any real
- * synchronization but merely completes the repository system.
- */
-@Named
-public class DefaultSyncContextFactory
-    implements SyncContextFactory
-{
-
-    public SyncContext newInstance( RepositorySystemSession session, boolean shared )
-    {
-        return new DefaultSyncContext();
-    }
-
-    static class DefaultSyncContext
-        implements SyncContext
-    {
-
-        public void acquire( Collection<? extends Artifact> artifact, Collection<? extends Metadata> metadata )
-        {
-        }
-
-        public void close()
-        {
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/3a1b8ae0/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java
----------------------------------------------------------------------
diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java
deleted file mode 100644
index 133fd81..0000000
--- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package org.eclipse.aether.internal.impl;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.spi.connector.transport.Transporter;
-import org.eclipse.aether.spi.connector.transport.TransporterFactory;
-import org.eclipse.aether.spi.connector.transport.TransporterProvider;
-import org.eclipse.aether.spi.locator.Service;
-import org.eclipse.aether.spi.locator.ServiceLocator;
-import org.eclipse.aether.spi.log.Logger;
-import org.eclipse.aether.spi.log.LoggerFactory;
-import org.eclipse.aether.spi.log.NullLoggerFactory;
-import org.eclipse.aether.transfer.NoTransporterException;
-
-/**
- */
-@Named
-public final class DefaultTransporterProvider
-    implements TransporterProvider, Service
-{
-
-    private Logger logger = NullLoggerFactory.LOGGER;
-
-    private Collection<TransporterFactory> factories = new ArrayList<TransporterFactory>();
-
-    public DefaultTransporterProvider()
-    {
-        // enables default constructor
-    }
-
-    @Inject
-    DefaultTransporterProvider( Set<TransporterFactory> transporterFactories, LoggerFactory loggerFactory )
-    {
-        setLoggerFactory( loggerFactory );
-        setTransporterFactories( transporterFactories );
-    }
-
-    public void initService( ServiceLocator locator )
-    {
-        setLoggerFactory( locator.getService( LoggerFactory.class ) );
-        setTransporterFactories( locator.getServices( TransporterFactory.class ) );
-    }
-
-    public DefaultTransporterProvider setLoggerFactory( LoggerFactory loggerFactory )
-    {
-        this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
-        return this;
-    }
-
-    public DefaultTransporterProvider addTransporterFactory( TransporterFactory factory )
-    {
-        if ( factory == null )
-        {
-            throw new IllegalArgumentException( "transporter factory has not been specified" );
-        }
-        factories.add( factory );
-        return this;
-    }
-
-    public DefaultTransporterProvider setTransporterFactories( Collection<TransporterFactory> factories )
-    {
-        if ( factories == null )
-        {
-            this.factories = new ArrayList<TransporterFactory>();
-        }
-        else
-        {
-            this.factories = factories;
-        }
-        return this;
-    }
-
-    public Transporter newTransporter( RepositorySystemSession session, RemoteRepository repository )
-        throws NoTransporterException
-    {
-        if ( repository == null )
-        {
-            throw new IllegalArgumentException( "remote repository has not been specified" );
-        }
-
-        PrioritizedComponents<TransporterFactory> factories = new PrioritizedComponents<TransporterFactory>( session );
-        for ( TransporterFactory factory : this.factories )
-        {
-            factories.add( factory, factory.getPriority() );
-        }
-
-        List<NoTransporterException> errors = new ArrayList<NoTransporterException>();
-        for ( PrioritizedComponent<TransporterFactory> factory : factories.getEnabled() )
-        {
-            try
-            {
-                Transporter transporter = factory.getComponent().newInstance( session, repository );
-
-                if ( logger.isDebugEnabled() )
-                {
-                    StringBuilder buffer = new StringBuilder( 256 );
-                    buffer.append( "Using transporter " ).append( transporter.getClass().getSimpleName() );
-                    Utils.appendClassLoader( buffer, transporter );
-                    buffer.append( " with priority " ).append( factory.getPriority() );
-                    buffer.append( " for " ).append( repository.getUrl() );
-                    logger.debug( buffer.toString() );
-                }
-
-                return transporter;
-            }
-            catch ( NoTransporterException e )
-            {
-                // continue and try next factory
-                errors.add( e );
-            }
-        }
-        if ( logger.isDebugEnabled() && errors.size() > 1 )
-        {
-            String msg = "Could not obtain transporter factory for " + repository;
-            for ( Exception e : errors )
-            {
-                logger.debug( msg, e );
-            }
-        }
-
-        StringBuilder buffer = new StringBuilder( 256 );
-        if ( factories.isEmpty() )
-        {
-            buffer.append( "No transporter factories registered" );
-        }
-        else
-        {
-            buffer.append( "Cannot access " ).append( repository.getUrl() );
-            buffer.append( " using the registered transporter factories: " );
-            factories.list( buffer );
-        }
-
-        throw new NoTransporterException( repository, buffer.toString(), errors.size() == 1 ? errors.get( 0 ) : null );
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/3a1b8ae0/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java
----------------------------------------------------------------------
diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java
deleted file mode 100644
index eb4eff9..0000000
--- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java
+++ /dev/null
@@ -1,629 +0,0 @@
-package org.eclipse.aether.internal.impl;
-
-/*
- * 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 java.io.File;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.SessionData;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.impl.UpdateCheck;
-import org.eclipse.aether.impl.UpdateCheckManager;
-import org.eclipse.aether.impl.UpdatePolicyAnalyzer;
-import org.eclipse.aether.metadata.Metadata;
-import org.eclipse.aether.repository.AuthenticationDigest;
-import org.eclipse.aether.repository.Proxy;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.ResolutionErrorPolicy;
-import org.eclipse.aether.spi.locator.Service;
-import org.eclipse.aether.spi.locator.ServiceLocator;
-import org.eclipse.aether.spi.log.Logger;
-import org.eclipse.aether.spi.log.LoggerFactory;
-import org.eclipse.aether.spi.log.NullLoggerFactory;
-import org.eclipse.aether.transfer.ArtifactNotFoundException;
-import org.eclipse.aether.transfer.ArtifactTransferException;
-import org.eclipse.aether.transfer.MetadataNotFoundException;
-import org.eclipse.aether.transfer.MetadataTransferException;
-import org.eclipse.aether.util.ConfigUtils;
-
-/**
- */
-@Named
-public class DefaultUpdateCheckManager
-    implements UpdateCheckManager, Service
-{
-
-    private Logger logger = NullLoggerFactory.LOGGER;
-
-    private UpdatePolicyAnalyzer updatePolicyAnalyzer;
-
-    private static final String UPDATED_KEY_SUFFIX = ".lastUpdated";
-
-    private static final String ERROR_KEY_SUFFIX = ".error";
-
-    private static final String NOT_FOUND = "";
-
-    private static final String SESSION_CHECKS = "updateCheckManager.checks";
-
-    static final String CONFIG_PROP_SESSION_STATE = "aether.updateCheckManager.sessionState";
-
-    private static final int STATE_ENABLED = 0;
-
-    private static final int STATE_BYPASS = 1;
-
-    private static final int STATE_DISABLED = 2;
-
-    public DefaultUpdateCheckManager()
-    {
-        // enables default constructor
-    }
-
-    @Inject
-    DefaultUpdateCheckManager( UpdatePolicyAnalyzer updatePolicyAnalyzer, LoggerFactory loggerFactory )
-    {
-        setUpdatePolicyAnalyzer( updatePolicyAnalyzer );
-        setLoggerFactory( loggerFactory );
-    }
-
-    public void initService( ServiceLocator locator )
-    {
-        setLoggerFactory( locator.getService( LoggerFactory.class ) );
-        setUpdatePolicyAnalyzer( locator.getService( UpdatePolicyAnalyzer.class ) );
-    }
-
-    public DefaultUpdateCheckManager setLoggerFactory( LoggerFactory loggerFactory )
-    {
-        this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
-        return this;
-    }
-
-    public DefaultUpdateCheckManager setUpdatePolicyAnalyzer( UpdatePolicyAnalyzer updatePolicyAnalyzer )
-    {
-        if ( updatePolicyAnalyzer == null )
-        {
-            throw new IllegalArgumentException( "update policy analyzer has not been specified" );
-        }
-        this.updatePolicyAnalyzer = updatePolicyAnalyzer;
-        return this;
-    }
-
-    public void checkArtifact( RepositorySystemSession session, UpdateCheck<Artifact, ArtifactTransferException> check )
-    {
-        if ( check.getLocalLastUpdated() != 0
-            && !isUpdatedRequired( session, check.getLocalLastUpdated(), check.getPolicy() ) )
-        {
-            if ( logger.isDebugEnabled() )
-            {
-                logger.debug( "Skipped remote request for " + check.getItem()
-                    + ", locally installed artifact up-to-date." );
-            }
-
-            check.setRequired( false );
-            return;
-        }
-
-        Artifact artifact = check.getItem();
-        RemoteRepository repository = check.getRepository();
-
-        File artifactFile = check.getFile();
-        if ( artifactFile == null )
-        {
-            throw new IllegalArgumentException( String.format( "The artifact '%s' has no file attached", artifact ) );
-        }
-
-        boolean fileExists = check.isFileValid() && artifactFile.exists();
-
-        File touchFile = getTouchFile( artifact, artifactFile );
-        Properties props = read( touchFile );
-
-        String updateKey = getUpdateKey( session, artifactFile, repository );
-        String dataKey = getDataKey( artifact, artifactFile, repository );
-
-        String error = getError( props, dataKey );
-
-        long lastUpdated;
-        if ( error == null )
-        {
-            if ( fileExists )
-            {
-                // last update was successful
-                lastUpdated = artifactFile.lastModified();
-            }
-            else
-            {
-                // this is the first attempt ever
-                lastUpdated = 0;
-            }
-        }
-        else if ( error.length() <= 0 )
-        {
-            // artifact did not exist
-            lastUpdated = getLastUpdated( props, dataKey );
-        }
-        else
-        {
-            // artifact could not be transferred
-            String transferKey = getTransferKey( session, artifact, artifactFile, repository );
-            lastUpdated = getLastUpdated( props, transferKey );
-        }
-
-        if ( lastUpdated == 0 )
-        {
-            check.setRequired( true );
-        }
-        else if ( isAlreadyUpdated( session, updateKey ) )
-        {
-            if ( logger.isDebugEnabled() )
-            {
-                logger.debug( "Skipped remote request for " + check.getItem()
-                    + ", already updated during this session." );
-            }
-
-            check.setRequired( false );
-            if ( error != null )
-            {
-                check.setException( newException( error, artifact, repository ) );
-            }
-        }
-        else if ( isUpdatedRequired( session, lastUpdated, check.getPolicy() ) )
-        {
-            check.setRequired( true );
-        }
-        else if ( fileExists )
-        {
-            if ( logger.isDebugEnabled() )
-            {
-                logger.debug( "Skipped remote request for " + check.getItem() + ", locally cached artifact up-to-date." );
-            }
-
-            check.setRequired( false );
-        }
-        else
-        {
-            int errorPolicy = Utils.getPolicy( session, artifact, repository );
-            int cacheFlag = getCacheFlag( error );
-            if ( ( errorPolicy & cacheFlag ) != 0 )
-            {
-                check.setRequired( false );
-                check.setException( newException( error, artifact, repository ) );
-            }
-            else
-            {
-                check.setRequired( true );
-            }
-        }
-    }
-
-    private static int getCacheFlag( String error )
-    {
-        if ( error == null || error.length() <= 0 )
-        {
-            return ResolutionErrorPolicy.CACHE_NOT_FOUND;
-        }
-        else
-        {
-            return ResolutionErrorPolicy.CACHE_TRANSFER_ERROR;
-        }
-    }
-
-    private ArtifactTransferException newException( String error, Artifact artifact, RemoteRepository repository )
-    {
-        if ( error == null || error.length() <= 0 )
-        {
-            return new ArtifactNotFoundException( artifact, repository, "Failure to find " + artifact + " in "
-                + repository.getUrl() + " was cached in the local repository, "
-                + "resolution will not be reattempted until the update interval of " + repository.getId()
-                + " has elapsed or updates are forced", true );
-        }
-        else
-        {
-            return new ArtifactTransferException( artifact, repository, "Failure to transfer " + artifact + " from "
-                + repository.getUrl() + " was cached in the local repository, "
-                + "resolution will not be reattempted until the update interval of " + repository.getId()
-                + " has elapsed or updates are forced. Original error: " + error, true );
-        }
-    }
-
-    public void checkMetadata( RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check )
-    {
-        if ( check.getLocalLastUpdated() != 0
-            && !isUpdatedRequired( session, check.getLocalLastUpdated(), check.getPolicy() ) )
-        {
-            if ( logger.isDebugEnabled() )
-            {
-                logger.debug( "Skipped remote request for " + check.getItem()
-                    + ", locally installed metadata up-to-date." );
-            }
-
-            check.setRequired( false );
-            return;
-        }
-
-        Metadata metadata = check.getItem();
-        RemoteRepository repository = check.getRepository();
-
-        File metadataFile = check.getFile();
-        if ( metadataFile == null )
-        {
-            throw new IllegalArgumentException( String.format( "The metadata '%s' has no file attached", metadata ) );
-        }
-
-        boolean fileExists = check.isFileValid() && metadataFile.exists();
-
-        File touchFile = getTouchFile( metadata, metadataFile );
-        Properties props = read( touchFile );
-
-        String updateKey = getUpdateKey( session, metadataFile, repository );
-        String dataKey = getDataKey( metadata, metadataFile, check.getAuthoritativeRepository() );
-
-        String error = getError( props, dataKey );
-
-        long lastUpdated;
-        if ( error == null )
-        {
-            if ( fileExists )
-            {
-                // last update was successful
-                lastUpdated = getLastUpdated( props, dataKey );
-            }
-            else
-            {
-                // this is the first attempt ever
-                lastUpdated = 0;
-            }
-        }
-        else if ( error.length() <= 0 )
-        {
-            // metadata did not exist
-            lastUpdated = getLastUpdated( props, dataKey );
-        }
-        else
-        {
-            // metadata could not be transferred
-            String transferKey = getTransferKey( session, metadata, metadataFile, repository );
-            lastUpdated = getLastUpdated( props, transferKey );
-        }
-
-        if ( lastUpdated == 0 )
-        {
-            check.setRequired( true );
-        }
-        else if ( isAlreadyUpdated( session, updateKey ) )
-        {
-            if ( logger.isDebugEnabled() )
-            {
-                logger.debug( "Skipped remote request for " + check.getItem()
-                    + ", already updated during this session." );
-            }
-
-            check.setRequired( false );
-            if ( error != null )
-            {
-                check.setException( newException( error, metadata, repository ) );
-            }
-        }
-        else if ( isUpdatedRequired( session, lastUpdated, check.getPolicy() ) )
-        {
-            check.setRequired( true );
-        }
-        else if ( fileExists )
-        {
-            if ( logger.isDebugEnabled() )
-            {
-                logger.debug( "Skipped remote request for " + check.getItem() + ", locally cached metadata up-to-date." );
-            }
-
-            check.setRequired( false );
-        }
-        else
-        {
-            int errorPolicy = Utils.getPolicy( session, metadata, repository );
-            int cacheFlag = getCacheFlag( error );
-            if ( ( errorPolicy & cacheFlag ) != 0 )
-            {
-                check.setRequired( false );
-                check.setException( newException( error, metadata, repository ) );
-            }
-            else
-            {
-                check.setRequired( true );
-            }
-        }
-    }
-
-    private MetadataTransferException newException( String error, Metadata metadata, RemoteRepository repository )
-    {
-        if ( error == null || error.length() <= 0 )
-        {
-            return new MetadataNotFoundException( metadata, repository, "Failure to find " + metadata + " in "
-                + repository.getUrl() + " was cached in the local repository, "
-                + "resolution will not be reattempted until the update interval of " + repository.getId()
-                + " has elapsed or updates are forced", true );
-        }
-        else
-        {
-            return new MetadataTransferException( metadata, repository, "Failure to transfer " + metadata + " from "
-                + repository.getUrl() + " was cached in the local repository, "
-                + "resolution will not be reattempted until the update interval of " + repository.getId()
-                + " has elapsed or updates are forced. Original error: " + error, true );
-        }
-    }
-
-    private long getLastUpdated( Properties props, String key )
-    {
-        String value = props.getProperty( key + UPDATED_KEY_SUFFIX, "" );
-        try
-        {
-            return ( value.length() > 0 ) ? Long.parseLong( value ) : 1;
-        }
-        catch ( NumberFormatException e )
-        {
-            logger.debug( "Cannot parse lastUpdated date: \'" + value + "\'. Ignoring.", e );
-            return 1;
-        }
-    }
-
-    private String getError( Properties props, String key )
-    {
-        return props.getProperty( key + ERROR_KEY_SUFFIX );
-    }
-
-    private File getTouchFile( Artifact artifact, File artifactFile )
-    {
-        return new File( artifactFile.getPath() + ".lastUpdated" );
-    }
-
-    private File getTouchFile( Metadata metadata, File metadataFile )
-    {
-        return new File( metadataFile.getParent(), "resolver-status.properties" );
-    }
-
-    private String getDataKey( Artifact artifact, File artifactFile, RemoteRepository repository )
-    {
-        Set<String> mirroredUrls = Collections.emptySet();
-        if ( repository.isRepositoryManager() )
-        {
-            mirroredUrls = new TreeSet<String>();
-            for ( RemoteRepository mirroredRepository : repository.getMirroredRepositories() )
-            {
-                mirroredUrls.add( normalizeRepoUrl( mirroredRepository.getUrl() ) );
-            }
-        }
-
-        StringBuilder buffer = new StringBuilder( 1024 );
-
-        buffer.append( normalizeRepoUrl( repository.getUrl() ) );
-        for ( String mirroredUrl : mirroredUrls )
-        {
-            buffer.append( '+' ).append( mirroredUrl );
-        }
-
-        return buffer.toString();
-    }
-
-    private String getTransferKey( RepositorySystemSession session, Artifact artifact, File artifactFile,
-                                   RemoteRepository repository )
-    {
-        return getRepoKey( session, repository );
-    }
-
-    private String getDataKey( Metadata metadata, File metadataFile, RemoteRepository repository )
-    {
-        return metadataFile.getName();
-    }
-
-    private String getTransferKey( RepositorySystemSession session, Metadata metadata, File metadataFile,
-                                   RemoteRepository repository )
-    {
-        return metadataFile.getName() + '/' + getRepoKey( session, repository );
-    }
-
-    private String getRepoKey( RepositorySystemSession session, RemoteRepository repository )
-    {
-        StringBuilder buffer = new StringBuilder( 128 );
-
-        Proxy proxy = repository.getProxy();
-        if ( proxy != null )
-        {
-            buffer.append( AuthenticationDigest.forProxy( session, repository ) ).append( '@' );
-            buffer.append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '>' );
-        }
-
-        buffer.append( AuthenticationDigest.forRepository( session, repository ) ).append( '@' );
-
-        buffer.append( repository.getContentType() ).append( '-' );
-        buffer.append( repository.getId() ).append( '-' );
-        buffer.append( normalizeRepoUrl( repository.getUrl() ) );
-
-        return buffer.toString();
-    }
-
-    private String normalizeRepoUrl( String url )
-    {
-        String result = url;
-        if ( url != null && url.length() > 0 && !url.endsWith( "/" ) )
-        {
-            result = url + '/';
-        }
-        return result;
-    }
-
-    private String getUpdateKey( RepositorySystemSession session, File file, RemoteRepository repository )
-    {
-        return file.getAbsolutePath() + '|' + getRepoKey( session, repository );
-    }
-
-    private int getSessionState( RepositorySystemSession session )
-    {
-        String mode = ConfigUtils.getString( session, "true", CONFIG_PROP_SESSION_STATE );
-        if ( Boolean.parseBoolean( mode ) )
-        {
-            // perform update check at most once per session, regardless of update policy
-            return STATE_ENABLED;
-        }
-        else if ( "bypass".equalsIgnoreCase( mode ) )
-        {
-            // evaluate update policy but record update in session to prevent potential future checks
-            return STATE_BYPASS;
-        }
-        else
-        {
-            // no session state at all, always evaluate update policy
-            return STATE_DISABLED;
-        }
-    }
-
-    private boolean isAlreadyUpdated( RepositorySystemSession session, Object updateKey )
-    {
-        if ( getSessionState( session ) >= STATE_BYPASS )
-        {
-            return false;
-        }
-        SessionData data = session.getData();
-        Object checkedFiles = data.get( SESSION_CHECKS );
-        if ( !( checkedFiles instanceof Map ) )
-        {
-            return false;
-        }
-        return ( (Map<?, ?>) checkedFiles ).containsKey( updateKey );
-    }
-
-    @SuppressWarnings( "unchecked" )
-    private void setUpdated( RepositorySystemSession session, Object updateKey )
-    {
-        if ( getSessionState( session ) >= STATE_DISABLED )
-        {
-            return;
-        }
-        SessionData data = session.getData();
-        Object checkedFiles = data.get( SESSION_CHECKS );
-        while ( !( checkedFiles instanceof Map ) )
-        {
-            Object old = checkedFiles;
-            checkedFiles = new ConcurrentHashMap<Object, Object>( 256 );
-            if ( data.set( SESSION_CHECKS, old, checkedFiles ) )
-            {
-                break;
-            }
-            checkedFiles = data.get( SESSION_CHECKS );
-        }
-        ( (Map<Object, Boolean>) checkedFiles ).put( updateKey, Boolean.TRUE );
-    }
-
-    private boolean isUpdatedRequired( RepositorySystemSession session, long lastModified, String policy )
-    {
-        return updatePolicyAnalyzer.isUpdatedRequired( session, lastModified, policy );
-    }
-
-    private Properties read( File touchFile )
-    {
-        Properties props = new TrackingFileManager().setLogger( logger ).read( touchFile );
-        return ( props != null ) ? props : new Properties();
-    }
-
-    public void touchArtifact( RepositorySystemSession session, UpdateCheck<Artifact, ArtifactTransferException> check )
-    {
-        Artifact artifact = check.getItem();
-        File artifactFile = check.getFile();
-        File touchFile = getTouchFile( artifact, artifactFile );
-
-        String updateKey = getUpdateKey( session, artifactFile, check.getRepository() );
-        String dataKey = getDataKey( artifact, artifactFile, check.getAuthoritativeRepository() );
-        String transferKey = getTransferKey( session, artifact, artifactFile, check.getRepository() );
-
-        setUpdated( session, updateKey );
-        Properties props = write( touchFile, dataKey, transferKey, check.getException() );
-
-        if ( artifactFile.exists() && !hasErrors( props ) )
-        {
-            touchFile.delete();
-        }
-    }
-
-    private boolean hasErrors( Properties props )
-    {
-        for ( Object key : props.keySet() )
-        {
-            if ( key.toString().endsWith( ERROR_KEY_SUFFIX ) )
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public void touchMetadata( RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check )
-    {
-        Metadata metadata = check.getItem();
-        File metadataFile = check.getFile();
-        File touchFile = getTouchFile( metadata, metadataFile );
-
-        String updateKey = getUpdateKey( session, metadataFile, check.getRepository() );
-        String dataKey = getDataKey( metadata, metadataFile, check.getAuthoritativeRepository() );
-        String transferKey = getTransferKey( session, metadata, metadataFile, check.getRepository() );
-
-        setUpdated( session, updateKey );
-        write( touchFile, dataKey, transferKey, check.getException() );
-    }
-
-    private Properties write( File touchFile, String dataKey, String transferKey, Exception error )
-    {
-        Map<String, String> updates = new HashMap<String, String>();
-
-        String timestamp = Long.toString( System.currentTimeMillis() );
-
-        if ( error == null )
-        {
-            updates.put( dataKey + ERROR_KEY_SUFFIX, null );
-            updates.put( dataKey + UPDATED_KEY_SUFFIX, timestamp );
-            updates.put( transferKey + UPDATED_KEY_SUFFIX, null );
-        }
-        else if ( error instanceof ArtifactNotFoundException || error instanceof MetadataNotFoundException )
-        {
-            updates.put( dataKey + ERROR_KEY_SUFFIX, NOT_FOUND );
-            updates.put( dataKey + UPDATED_KEY_SUFFIX, timestamp );
-            updates.put( transferKey + UPDATED_KEY_SUFFIX, null );
-        }
-        else
-        {
-            String msg = error.getMessage();
-            if ( msg == null || msg.length() <= 0 )
-            {
-                msg = error.getClass().getSimpleName();
-            }
-            updates.put( dataKey + ERROR_KEY_SUFFIX, msg );
-            updates.put( dataKey + UPDATED_KEY_SUFFIX, null );
-            updates.put( transferKey + UPDATED_KEY_SUFFIX, timestamp );
-        }
-
-        return new TrackingFileManager().setLogger( logger ).update( touchFile, updates );
-    }
-
-}


Mime
View raw message