mirror of https://github.com/apache/maven.git
o Migrated to Eclipse Aether
This commit is contained in:
parent
71c145a0e6
commit
82b345e009
|
@ -80,7 +80,7 @@
|
|||
<artifactId>wagon-file</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-connector-wagon</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -50,19 +50,19 @@ under the License.
|
|||
<artifactId>maven-repository-metadata</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-spi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-util</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-impl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -73,6 +73,19 @@ under the License.
|
|||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice</artifactId>
|
||||
<version>3.0</version>
|
||||
<classifier>no_aop</classifier>
|
||||
<optional>true</optional>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>aopalliance</groupId>
|
||||
<artifactId>aopalliance</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -20,10 +20,10 @@ package org.apache.maven.repository.internal;
|
|||
*/
|
||||
|
||||
import org.apache.maven.model.Repository;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.RepositoryPolicy;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.RepositoryPolicy;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifact;
|
||||
|
||||
/**
|
||||
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
|
||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.maven.repository.internal;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
@ -28,6 +29,9 @@ import java.util.Map;
|
|||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.apache.maven.model.DependencyManagement;
|
||||
import org.apache.maven.model.DistributionManagement;
|
||||
import org.apache.maven.model.License;
|
||||
|
@ -45,52 +49,54 @@ import org.apache.maven.model.building.ModelProblem;
|
|||
import org.apache.maven.model.resolution.UnresolvableModelException;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositoryException;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.artifact.ArtifactType;
|
||||
import org.sonatype.aether.artifact.ArtifactTypeRegistry;
|
||||
import org.sonatype.aether.graph.Dependency;
|
||||
import org.sonatype.aether.graph.Exclusion;
|
||||
import org.sonatype.aether.impl.ArtifactDescriptorReader;
|
||||
import org.sonatype.aether.impl.ArtifactResolver;
|
||||
import org.sonatype.aether.impl.RemoteRepositoryManager;
|
||||
import org.sonatype.aether.impl.RepositoryEventDispatcher;
|
||||
import org.sonatype.aether.impl.VersionResolver;
|
||||
import org.sonatype.aether.transfer.ArtifactNotFoundException;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.artifact.ArtifactProperties;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifactType;
|
||||
import org.sonatype.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.sonatype.aether.repository.WorkspaceRepository;
|
||||
import org.sonatype.aether.resolution.ArtifactDescriptorException;
|
||||
import org.sonatype.aether.resolution.ArtifactDescriptorRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactDescriptorResult;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.resolution.ArtifactResult;
|
||||
import org.sonatype.aether.resolution.VersionRequest;
|
||||
import org.sonatype.aether.resolution.VersionResolutionException;
|
||||
import org.sonatype.aether.resolution.VersionResult;
|
||||
import org.sonatype.aether.spi.locator.Service;
|
||||
import org.sonatype.aether.spi.locator.ServiceLocator;
|
||||
import org.sonatype.aether.spi.log.Logger;
|
||||
import org.sonatype.aether.spi.log.NullLogger;
|
||||
import org.eclipse.aether.RepositoryException;
|
||||
import org.eclipse.aether.RepositoryEvent.EventType;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.ArtifactProperties;
|
||||
import org.eclipse.aether.artifact.ArtifactType;
|
||||
import org.eclipse.aether.artifact.ArtifactTypeRegistry;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.graph.Exclusion;
|
||||
import org.eclipse.aether.impl.ArtifactDescriptorReader;
|
||||
import org.eclipse.aether.impl.ArtifactResolver;
|
||||
import org.eclipse.aether.impl.RemoteRepositoryManager;
|
||||
import org.eclipse.aether.impl.RepositoryEventDispatcher;
|
||||
import org.eclipse.aether.impl.VersionResolver;
|
||||
import org.eclipse.aether.repository.WorkspaceRepository;
|
||||
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.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.transfer.ArtifactNotFoundException;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifactType;
|
||||
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
@Named
|
||||
@Component( role = ArtifactDescriptorReader.class )
|
||||
public class DefaultArtifactDescriptorReader
|
||||
implements ArtifactDescriptorReader, Service
|
||||
{
|
||||
|
||||
@SuppressWarnings( "unused" )
|
||||
@Requirement
|
||||
private Logger logger = NullLogger.INSTANCE;
|
||||
@Requirement( role = LoggerFactory.class )
|
||||
private Logger logger = NullLoggerFactory.LOGGER;
|
||||
|
||||
@Requirement
|
||||
private RemoteRepositoryManager remoteRepositoryManager;
|
||||
|
@ -107,9 +113,27 @@ public class DefaultArtifactDescriptorReader
|
|||
@Requirement
|
||||
private ModelBuilder modelBuilder;
|
||||
|
||||
public DefaultArtifactDescriptorReader()
|
||||
{
|
||||
// enable no-arg constructor
|
||||
}
|
||||
|
||||
@Inject
|
||||
DefaultArtifactDescriptorReader( RemoteRepositoryManager remoteRepositoryManager, VersionResolver versionResolver,
|
||||
ArtifactResolver artifactResolver, ModelBuilder modelBuilder,
|
||||
RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory )
|
||||
{
|
||||
setRemoteRepositoryManager( remoteRepositoryManager );
|
||||
setVersionResolver( versionResolver );
|
||||
setArtifactResolver( artifactResolver );
|
||||
setModelBuilder( modelBuilder );
|
||||
setLoggerFactory( loggerFactory );
|
||||
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
||||
}
|
||||
|
||||
public void initService( ServiceLocator locator )
|
||||
{
|
||||
setLogger( locator.getService( Logger.class ) );
|
||||
setLoggerFactory( locator.getService( LoggerFactory.class ) );
|
||||
setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) );
|
||||
setVersionResolver( locator.getService( VersionResolver.class ) );
|
||||
setArtifactResolver( locator.getService( ArtifactResolver.class ) );
|
||||
|
@ -121,12 +145,18 @@ public class DefaultArtifactDescriptorReader
|
|||
}
|
||||
}
|
||||
|
||||
public DefaultArtifactDescriptorReader setLogger( Logger logger )
|
||||
public DefaultArtifactDescriptorReader setLoggerFactory( LoggerFactory loggerFactory )
|
||||
{
|
||||
this.logger = ( logger != null ) ? logger : NullLogger.INSTANCE;
|
||||
this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
|
||||
return this;
|
||||
}
|
||||
|
||||
void setLogger( LoggerFactory loggerFactory )
|
||||
{
|
||||
// plexus support
|
||||
setLoggerFactory( loggerFactory );
|
||||
}
|
||||
|
||||
public DefaultArtifactDescriptorReader setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager )
|
||||
{
|
||||
if ( remoteRepositoryManager == null )
|
||||
|
@ -228,6 +258,8 @@ public class DefaultArtifactDescriptorReader
|
|||
}
|
||||
|
||||
result.setProperties( properties );
|
||||
|
||||
setArtifactProperties( result, model );
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -382,6 +414,23 @@ public class DefaultArtifactDescriptorReader
|
|||
return relocation;
|
||||
}
|
||||
|
||||
private void setArtifactProperties( ArtifactDescriptorResult result, Model model )
|
||||
{
|
||||
String downloadUrl = null;
|
||||
DistributionManagement distMngt = model.getDistributionManagement();
|
||||
if ( distMngt != null )
|
||||
{
|
||||
downloadUrl = distMngt.getDownloadUrl();
|
||||
}
|
||||
if ( downloadUrl != null && downloadUrl.length() > 0 )
|
||||
{
|
||||
Artifact artifact = result.getArtifact();
|
||||
Map<String, String> props = new HashMap<String, String>( artifact.getProperties() );
|
||||
props.put( ArtifactProperties.DOWNLOAD_URL, downloadUrl );
|
||||
result.setArtifact( artifact.setProperties( props ) );
|
||||
}
|
||||
}
|
||||
|
||||
private Dependency convert( org.apache.maven.model.Dependency dependency, ArtifactTypeRegistry stereotypes )
|
||||
{
|
||||
ArtifactType stereotype = stereotypes.get( dependency.getType() );
|
||||
|
|
|
@ -20,8 +20,8 @@ package org.apache.maven.repository.internal;
|
|||
*/
|
||||
|
||||
import org.apache.maven.model.building.ModelCache;
|
||||
import org.sonatype.aether.RepositoryCache;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RepositoryCache;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
|
||||
/**
|
||||
* A model builder cache backed by the repository system cache.
|
||||
|
|
|
@ -31,15 +31,15 @@ import org.apache.maven.model.building.ModelSource;
|
|||
import org.apache.maven.model.resolution.InvalidRepositoryException;
|
||||
import org.apache.maven.model.resolution.ModelResolver;
|
||||
import org.apache.maven.model.resolution.UnresolvableModelException;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.impl.ArtifactResolver;
|
||||
import org.sonatype.aether.impl.RemoteRepositoryManager;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.impl.ArtifactResolver;
|
||||
import org.eclipse.aether.impl.RemoteRepositoryManager;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.resolution.ArtifactRequest;
|
||||
import org.eclipse.aether.resolution.ArtifactResolutionException;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifact;
|
||||
|
||||
/**
|
||||
* A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have
|
||||
|
@ -93,7 +93,7 @@ class DefaultModelResolver
|
|||
public void addRepository( Repository repository )
|
||||
throws InvalidRepositoryException
|
||||
{
|
||||
if ( !repositoryIds.add( repository.getId() ) )
|
||||
if ( session.isIgnoreArtifactDescriptorRepositories() || !repositoryIds.add( repository.getId() ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
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.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 assists 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
|
||||
* @deprecated use {@link MavenServiceLocator} instead, which is more explicit.
|
||||
*/
|
||||
public class DefaultServiceLocator
|
||||
extends org.sonatype.aether.impl.internal.DefaultServiceLocator
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates a new service locator that already knows about all service implementations included this library.
|
||||
*/
|
||||
public DefaultServiceLocator()
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
}
|
|
@ -26,44 +26,49 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.apache.maven.artifact.repository.metadata.Versioning;
|
||||
import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.util.IOUtil;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.SyncContext;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.sonatype.aether.util.metadata.DefaultMetadata;
|
||||
import org.sonatype.aether.util.version.GenericVersionScheme;
|
||||
import org.sonatype.aether.version.InvalidVersionSpecificationException;
|
||||
import org.sonatype.aether.version.Version;
|
||||
import org.sonatype.aether.version.VersionConstraint;
|
||||
import org.sonatype.aether.version.VersionScheme;
|
||||
import org.sonatype.aether.impl.MetadataResolver;
|
||||
import org.sonatype.aether.impl.RepositoryEventDispatcher;
|
||||
import org.sonatype.aether.impl.SyncContextFactory;
|
||||
import org.sonatype.aether.impl.VersionRangeResolver;
|
||||
import org.sonatype.aether.metadata.Metadata;
|
||||
import org.sonatype.aether.repository.ArtifactRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.resolution.MetadataRequest;
|
||||
import org.sonatype.aether.resolution.MetadataResult;
|
||||
import org.sonatype.aether.resolution.VersionRangeRequest;
|
||||
import org.sonatype.aether.resolution.VersionRangeResolutionException;
|
||||
import org.sonatype.aether.resolution.VersionRangeResult;
|
||||
import org.sonatype.aether.spi.locator.Service;
|
||||
import org.sonatype.aether.spi.locator.ServiceLocator;
|
||||
import org.sonatype.aether.spi.log.Logger;
|
||||
import org.sonatype.aether.spi.log.NullLogger;
|
||||
import org.eclipse.aether.RepositoryEvent.EventType;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.SyncContext;
|
||||
import org.eclipse.aether.impl.MetadataResolver;
|
||||
import org.eclipse.aether.impl.RepositoryEventDispatcher;
|
||||
import org.eclipse.aether.impl.SyncContextFactory;
|
||||
import org.eclipse.aether.impl.VersionRangeResolver;
|
||||
import org.eclipse.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.repository.ArtifactRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.WorkspaceReader;
|
||||
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.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.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.eclipse.aether.util.metadata.DefaultMetadata;
|
||||
import org.eclipse.aether.util.version.GenericVersionScheme;
|
||||
import org.eclipse.aether.version.InvalidVersionSpecificationException;
|
||||
import org.eclipse.aether.version.Version;
|
||||
import org.eclipse.aether.version.VersionConstraint;
|
||||
import org.eclipse.aether.version.VersionScheme;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
@Named
|
||||
@Component( role = VersionRangeResolver.class )
|
||||
public class DefaultVersionRangeResolver
|
||||
implements VersionRangeResolver, Service
|
||||
|
@ -72,8 +77,8 @@ public class DefaultVersionRangeResolver
|
|||
private static final String MAVEN_METADATA_XML = "maven-metadata.xml";
|
||||
|
||||
@SuppressWarnings( "unused" )
|
||||
@Requirement
|
||||
private Logger logger = NullLogger.INSTANCE;
|
||||
@Requirement( role = LoggerFactory.class )
|
||||
private Logger logger = NullLoggerFactory.LOGGER;
|
||||
|
||||
@Requirement
|
||||
private MetadataResolver metadataResolver;
|
||||
|
@ -84,20 +89,41 @@ public class DefaultVersionRangeResolver
|
|||
@Requirement
|
||||
private RepositoryEventDispatcher repositoryEventDispatcher;
|
||||
|
||||
public DefaultVersionRangeResolver()
|
||||
{
|
||||
// enable default constructor
|
||||
}
|
||||
|
||||
@Inject
|
||||
DefaultVersionRangeResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory,
|
||||
RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory )
|
||||
{
|
||||
setMetadataResolver( metadataResolver );
|
||||
setSyncContextFactory( syncContextFactory );
|
||||
setLoggerFactory( loggerFactory );
|
||||
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
||||
}
|
||||
|
||||
public void initService( ServiceLocator locator )
|
||||
{
|
||||
setLogger( locator.getService( Logger.class ) );
|
||||
setLoggerFactory( locator.getService( LoggerFactory.class ) );
|
||||
setMetadataResolver( locator.getService( MetadataResolver.class ) );
|
||||
setSyncContextFactory( locator.getService( SyncContextFactory.class ) );
|
||||
setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
|
||||
}
|
||||
|
||||
public DefaultVersionRangeResolver setLogger( Logger logger )
|
||||
public DefaultVersionRangeResolver setLoggerFactory( LoggerFactory loggerFactory )
|
||||
{
|
||||
this.logger = ( logger != null ) ? logger : NullLogger.INSTANCE;
|
||||
this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
|
||||
return this;
|
||||
}
|
||||
|
||||
void setLogger( LoggerFactory loggerFactory )
|
||||
{
|
||||
// plexus support
|
||||
setLoggerFactory( loggerFactory );
|
||||
}
|
||||
|
||||
public DefaultVersionRangeResolver setMetadataResolver( MetadataResolver metadataResolver )
|
||||
{
|
||||
if ( metadataResolver == null )
|
||||
|
@ -148,7 +174,7 @@ public class DefaultVersionRangeResolver
|
|||
|
||||
result.setVersionConstraint( versionConstraint );
|
||||
|
||||
if ( versionConstraint.getRanges().isEmpty() )
|
||||
if ( versionConstraint.getRange() == null )
|
||||
{
|
||||
result.addVersion( versionConstraint.getVersion() );
|
||||
}
|
||||
|
@ -265,7 +291,7 @@ public class DefaultVersionRangeResolver
|
|||
}
|
||||
finally
|
||||
{
|
||||
syncContext.release();
|
||||
syncContext.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,9 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.apache.maven.artifact.repository.metadata.Snapshot;
|
||||
import org.apache.maven.artifact.repository.metadata.SnapshotVersion;
|
||||
import org.apache.maven.artifact.repository.metadata.Versioning;
|
||||
|
@ -36,40 +39,42 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.util.IOUtil;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.sonatype.aether.ConfigurationProperties;
|
||||
import org.sonatype.aether.RepositoryCache;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.SyncContext;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.sonatype.aether.util.metadata.DefaultMetadata;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.impl.MetadataResolver;
|
||||
import org.sonatype.aether.impl.RepositoryEventDispatcher;
|
||||
import org.sonatype.aether.impl.SyncContextFactory;
|
||||
import org.sonatype.aether.impl.VersionResolver;
|
||||
import org.sonatype.aether.impl.internal.CacheUtils;
|
||||
import org.sonatype.aether.metadata.Metadata;
|
||||
import org.sonatype.aether.repository.ArtifactRepository;
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.repository.WorkspaceRepository;
|
||||
import org.sonatype.aether.resolution.MetadataRequest;
|
||||
import org.sonatype.aether.resolution.MetadataResult;
|
||||
import org.sonatype.aether.resolution.VersionRequest;
|
||||
import org.sonatype.aether.resolution.VersionResolutionException;
|
||||
import org.sonatype.aether.resolution.VersionResult;
|
||||
import org.sonatype.aether.spi.locator.Service;
|
||||
import org.sonatype.aether.spi.locator.ServiceLocator;
|
||||
import org.sonatype.aether.spi.log.Logger;
|
||||
import org.sonatype.aether.spi.log.NullLogger;
|
||||
import org.eclipse.aether.RepositoryCache;
|
||||
import org.eclipse.aether.RepositoryEvent.EventType;
|
||||
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.impl.MetadataResolver;
|
||||
import org.eclipse.aether.impl.RepositoryEventDispatcher;
|
||||
import org.eclipse.aether.impl.SyncContextFactory;
|
||||
import org.eclipse.aether.impl.VersionResolver;
|
||||
import org.eclipse.aether.internal.impl.CacheUtils;
|
||||
import org.eclipse.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.repository.ArtifactRepository;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.WorkspaceReader;
|
||||
import org.eclipse.aether.repository.WorkspaceRepository;
|
||||
import org.eclipse.aether.resolution.MetadataRequest;
|
||||
import org.eclipse.aether.resolution.MetadataResult;
|
||||
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.ConfigUtils;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.eclipse.aether.util.metadata.DefaultMetadata;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
@Named
|
||||
@Component( role = VersionResolver.class )
|
||||
public class DefaultVersionResolver
|
||||
implements VersionResolver, Service
|
||||
|
@ -84,8 +89,8 @@ public class DefaultVersionResolver
|
|||
private static final String SNAPSHOT = "SNAPSHOT";
|
||||
|
||||
@SuppressWarnings( "unused" )
|
||||
@Requirement
|
||||
private Logger logger = NullLogger.INSTANCE;
|
||||
@Requirement( role = LoggerFactory.class )
|
||||
private Logger logger = NullLoggerFactory.LOGGER;
|
||||
|
||||
@Requirement
|
||||
private MetadataResolver metadataResolver;
|
||||
|
@ -96,20 +101,41 @@ public class DefaultVersionResolver
|
|||
@Requirement
|
||||
private RepositoryEventDispatcher repositoryEventDispatcher;
|
||||
|
||||
public DefaultVersionResolver()
|
||||
{
|
||||
// enable no-arg constructor
|
||||
}
|
||||
|
||||
@Inject
|
||||
DefaultVersionResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory,
|
||||
RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory )
|
||||
{
|
||||
setMetadataResolver( metadataResolver );
|
||||
setSyncContextFactory( syncContextFactory );
|
||||
setLoggerFactory( loggerFactory );
|
||||
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
||||
}
|
||||
|
||||
public void initService( ServiceLocator locator )
|
||||
{
|
||||
setLogger( locator.getService( Logger.class ) );
|
||||
setLoggerFactory( locator.getService( LoggerFactory.class ) );
|
||||
setMetadataResolver( locator.getService( MetadataResolver.class ) );
|
||||
setSyncContextFactory( locator.getService( SyncContextFactory.class ) );
|
||||
setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
|
||||
}
|
||||
|
||||
public DefaultVersionResolver setLogger( Logger logger )
|
||||
public DefaultVersionResolver setLoggerFactory( LoggerFactory loggerFactory )
|
||||
{
|
||||
this.logger = ( logger != null ) ? logger : NullLogger.INSTANCE;
|
||||
this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
|
||||
return this;
|
||||
}
|
||||
|
||||
void setLogger( LoggerFactory loggerFactory )
|
||||
{
|
||||
// plexus support
|
||||
setLoggerFactory( loggerFactory );
|
||||
}
|
||||
|
||||
public DefaultVersionResolver setMetadataResolver( MetadataResolver metadataResolver )
|
||||
{
|
||||
if ( metadataResolver == null )
|
||||
|
@ -153,7 +179,7 @@ public class DefaultVersionResolver
|
|||
|
||||
Key cacheKey = null;
|
||||
RepositoryCache cache = session.getCache();
|
||||
if ( cache != null && !ConfigurationProperties.get( session, "aether.versionResolver.noCache", false ) )
|
||||
if ( cache != null && !ConfigUtils.getBoolean( session, false, "aether.versionResolver.noCache" ) )
|
||||
{
|
||||
cacheKey = new Key( session, request );
|
||||
|
||||
|
@ -355,7 +381,7 @@ public class DefaultVersionResolver
|
|||
}
|
||||
finally
|
||||
{
|
||||
syncContext.release();
|
||||
syncContext.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.apache.maven.artifact.repository.metadata.Metadata;
|
|||
import org.apache.maven.artifact.repository.metadata.Snapshot;
|
||||
import org.apache.maven.artifact.repository.metadata.SnapshotVersion;
|
||||
import org.apache.maven.artifact.repository.metadata.Versioning;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -24,12 +24,12 @@ import java.util.Collections;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sonatype.aether.ConfigurationProperties;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.impl.MetadataGenerator;
|
||||
import org.sonatype.aether.installation.InstallRequest;
|
||||
import org.sonatype.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.impl.MetadataGenerator;
|
||||
import org.eclipse.aether.installation.InstallRequest;
|
||||
import org.eclipse.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.util.ConfigUtils;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
@ -44,7 +44,7 @@ class LocalSnapshotMetadataGenerator
|
|||
|
||||
public LocalSnapshotMetadataGenerator( RepositorySystemSession session, InstallRequest request )
|
||||
{
|
||||
legacyFormat = ConfigurationProperties.get( session.getConfigProperties(), "maven.metadata.legacy", false );
|
||||
legacyFormat = ConfigUtils.getBoolean( session.getConfigProperties(), false, "maven.metadata.legacy" );
|
||||
|
||||
snapshots = new LinkedHashMap<Object, LocalSnapshotMetadata>();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package org.apache.maven.repository.internal;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.apache.maven.model.building.DefaultModelBuilderFactory;
|
||||
import org.apache.maven.model.building.ModelBuilder;
|
||||
import org.eclipse.aether.impl.AetherModule;
|
||||
import org.eclipse.aether.impl.ArtifactDescriptorReader;
|
||||
import org.eclipse.aether.impl.MetadataGeneratorFactory;
|
||||
import org.eclipse.aether.impl.VersionRangeResolver;
|
||||
import org.eclipse.aether.impl.VersionResolver;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.name.Names;
|
||||
|
||||
public final class MavenAetherModule
|
||||
extends AbstractModule
|
||||
{
|
||||
|
||||
@Override
|
||||
protected void configure()
|
||||
{
|
||||
install( new AetherModule() );
|
||||
bind( ArtifactDescriptorReader.class ) //
|
||||
.to( DefaultArtifactDescriptorReader.class ).in( Singleton.class );
|
||||
bind( VersionResolver.class ) //
|
||||
.to( DefaultVersionResolver.class ).in( Singleton.class );
|
||||
bind( VersionRangeResolver.class ) //
|
||||
.to( DefaultVersionRangeResolver.class ).in( Singleton.class );
|
||||
bind( MetadataGeneratorFactory.class ).annotatedWith( Names.named( "snapshot" ) ) //
|
||||
.to( SnapshotMetadataGeneratorFactory.class ).in( Singleton.class );
|
||||
bind( MetadataGeneratorFactory.class ).annotatedWith( Names.named( "versions" ) ) //
|
||||
.to( VersionsMetadataGeneratorFactory.class ).in( Singleton.class );
|
||||
bind( ModelBuilder.class ) //
|
||||
.toInstance( new DefaultModelBuilderFactory().newInstance() );
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Set<MetadataGeneratorFactory> provideMetadataGeneratorFactories( @Named( "snapshot" ) MetadataGeneratorFactory snapshot,
|
||||
@Named( "versions" ) MetadataGeneratorFactory versions )
|
||||
{
|
||||
Set<MetadataGeneratorFactory> factories = new HashSet<MetadataGeneratorFactory>();
|
||||
factories.add( snapshot );
|
||||
factories.add( versions );
|
||||
return Collections.unmodifiableSet( factories );
|
||||
}
|
||||
|
||||
}
|
|
@ -31,8 +31,8 @@ import org.codehaus.plexus.util.IOUtil;
|
|||
import org.codehaus.plexus.util.ReaderFactory;
|
||||
import org.codehaus.plexus.util.WriterFactory;
|
||||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
||||
import org.sonatype.aether.RepositoryException;
|
||||
import org.sonatype.aether.metadata.MergeableMetadata;
|
||||
import org.eclipse.aether.RepositoryException;
|
||||
import org.eclipse.aether.metadata.MergeableMetadata;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
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.collection.DependencyGraphTransformer;
|
||||
import org.sonatype.aether.collection.DependencyManager;
|
||||
import org.sonatype.aether.collection.DependencySelector;
|
||||
import org.sonatype.aether.collection.DependencyTraverser;
|
||||
import org.sonatype.aether.util.DefaultRepositorySystemSession;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifactType;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifactTypeRegistry;
|
||||
import org.sonatype.aether.util.graph.manager.ClassicDependencyManager;
|
||||
import org.sonatype.aether.util.graph.selector.AndDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.ExclusionDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.OptionalDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.ScopeDependencySelector;
|
||||
import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
|
||||
import org.sonatype.aether.util.graph.transformer.ConflictMarker;
|
||||
import org.sonatype.aether.util.graph.transformer.JavaDependencyContextRefiner;
|
||||
import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
|
||||
import org.sonatype.aether.util.graph.transformer.NearestVersionConflictResolver;
|
||||
import org.sonatype.aether.util.graph.traverser.FatArtifactTraverser;
|
||||
import org.sonatype.aether.util.repository.DefaultAuthenticationSelector;
|
||||
import org.sonatype.aether.util.repository.DefaultMirrorSelector;
|
||||
import org.sonatype.aether.util.repository.DefaultProxySelector;
|
||||
|
||||
/**
|
||||
* A simplistic repository system session that mimics Maven's behavior to help third-party developers that want to embed
|
||||
* Maven's dependency resolution into their own applications. <strong>Warning:</strong> This class is not intended for
|
||||
* usage by Maven plugins, those should always acquire the current repository system session via parameter injection.
|
||||
*
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
public class MavenRepositorySystemSession
|
||||
extends DefaultRepositorySystemSession
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates a new Maven-like repository system session by initializing the session with values typical for
|
||||
* Maven-based resolution. In more detail, this constructor configures settings relevant for the processing of
|
||||
* dependency graphs, most other settings remain at their generic default value. Use the various setters to further
|
||||
* configure the session with authentication, mirror, proxy and other information required for your environment.
|
||||
*/
|
||||
public MavenRepositorySystemSession()
|
||||
{
|
||||
setMirrorSelector( new DefaultMirrorSelector() );
|
||||
setAuthenticationSelector( new DefaultAuthenticationSelector() );
|
||||
setProxySelector( new DefaultProxySelector() );
|
||||
|
||||
DependencyTraverser depTraverser = new FatArtifactTraverser();
|
||||
setDependencyTraverser( depTraverser );
|
||||
|
||||
DependencyManager depManager = new ClassicDependencyManager();
|
||||
setDependencyManager( depManager );
|
||||
|
||||
DependencySelector depFilter =
|
||||
new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ),
|
||||
new OptionalDependencySelector(), new ExclusionDependencySelector() );
|
||||
setDependencySelector( depFilter );
|
||||
|
||||
DependencyGraphTransformer transformer =
|
||||
new ChainedDependencyGraphTransformer( new ConflictMarker(), new JavaEffectiveScopeCalculator(),
|
||||
new NearestVersionConflictResolver(),
|
||||
new JavaDependencyContextRefiner() );
|
||||
setDependencyGraphTransformer( transformer );
|
||||
|
||||
DefaultArtifactTypeRegistry stereotypes = new DefaultArtifactTypeRegistry();
|
||||
stereotypes.add( new DefaultArtifactType( "pom" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "maven-plugin", "jar", "", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "jar", "jar", "", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "ejb", "jar", "", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "ejb-client", "jar", "client", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "test-jar", "jar", "tests", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "javadoc", "jar", "javadoc", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "java-source", "jar", "sources", "java", false, false ) );
|
||||
stereotypes.add( new DefaultArtifactType( "war", "war", "", "java", false, true ) );
|
||||
stereotypes.add( new DefaultArtifactType( "ear", "ear", "", "java", false, true ) );
|
||||
stereotypes.add( new DefaultArtifactType( "rar", "rar", "", "java", false, true ) );
|
||||
stereotypes.add( new DefaultArtifactType( "par", "par", "", "java", false, true ) );
|
||||
setArtifactTypeRegistry( stereotypes );
|
||||
|
||||
setIgnoreInvalidArtifactDescriptor( true );
|
||||
setIgnoreMissingArtifactDescriptor( true );
|
||||
|
||||
setSystemProps( System.getProperties() );
|
||||
setConfigProps( System.getProperties() );
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,134 @@
|
|||
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 java.util.Properties;
|
||||
|
||||
import org.eclipse.aether.collection.DependencyGraphTransformer;
|
||||
import org.eclipse.aether.collection.DependencyManager;
|
||||
import org.eclipse.aether.collection.DependencySelector;
|
||||
import org.eclipse.aether.collection.DependencyTraverser;
|
||||
import org.eclipse.aether.impl.ArtifactDescriptorReader;
|
||||
import org.eclipse.aether.impl.DefaultServiceLocator;
|
||||
import org.eclipse.aether.impl.MetadataGeneratorFactory;
|
||||
import org.eclipse.aether.impl.VersionRangeResolver;
|
||||
import org.eclipse.aether.impl.VersionResolver;
|
||||
import org.eclipse.aether.util.DefaultRepositorySystemSession;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifactType;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry;
|
||||
import org.eclipse.aether.util.graph.manager.ClassicDependencyManager;
|
||||
import org.eclipse.aether.util.graph.selector.AndDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.OptionalDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.ScopeDependencySelector;
|
||||
import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
|
||||
import org.eclipse.aether.util.graph.transformer.ConflictMarker;
|
||||
import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner;
|
||||
import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
|
||||
import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver;
|
||||
import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser;
|
||||
|
||||
/**
|
||||
* A utility class to assist in setting up a Maven-like repository system. <em>Note:</em> This component is meant to
|
||||
* assist those clients that employ the repository system outside of an IoC container, Maven plugins should instead
|
||||
* always use regular dependency injection to acquire the repository system.
|
||||
*
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
public final class MavenRepositorySystemUtils
|
||||
{
|
||||
|
||||
private MavenRepositorySystemUtils()
|
||||
{
|
||||
// hide constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new service locator that already knows about all service implementations included in this library. To
|
||||
* acquire a complete repository system, clients need to add some repository connectors for remote transfers.
|
||||
*
|
||||
* @return The new service locator, never {@code null}.
|
||||
*/
|
||||
public static DefaultServiceLocator newServiceLocator()
|
||||
{
|
||||
DefaultServiceLocator locator = new DefaultServiceLocator();
|
||||
locator.addService( ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class );
|
||||
locator.addService( VersionResolver.class, DefaultVersionResolver.class );
|
||||
locator.addService( VersionRangeResolver.class, DefaultVersionRangeResolver.class );
|
||||
locator.addService( MetadataGeneratorFactory.class, SnapshotMetadataGeneratorFactory.class );
|
||||
locator.addService( MetadataGeneratorFactory.class, VersionsMetadataGeneratorFactory.class );
|
||||
return locator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Maven-like repository system session by initializing the session with values typical for
|
||||
* Maven-based resolution. In more detail, this method configures settings relevant for the processing of dependency
|
||||
* graphs, most other settings remain at their generic default value. Use the various setters to further configure
|
||||
* the session with authentication, mirror, proxy and other information required for your environment.
|
||||
*
|
||||
* @return The new repository system session, never {@code null}.
|
||||
*/
|
||||
public static DefaultRepositorySystemSession newSession()
|
||||
{
|
||||
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
|
||||
|
||||
DependencyTraverser depTraverser = new FatArtifactTraverser();
|
||||
session.setDependencyTraverser( depTraverser );
|
||||
|
||||
DependencyManager depManager = new ClassicDependencyManager();
|
||||
session.setDependencyManager( depManager );
|
||||
|
||||
DependencySelector depFilter =
|
||||
new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ),
|
||||
new OptionalDependencySelector(), new ExclusionDependencySelector() );
|
||||
session.setDependencySelector( depFilter );
|
||||
|
||||
DependencyGraphTransformer transformer =
|
||||
new ChainedDependencyGraphTransformer( new ConflictMarker(), new JavaEffectiveScopeCalculator(),
|
||||
new NearestVersionConflictResolver(),
|
||||
new JavaDependencyContextRefiner() );
|
||||
session.setDependencyGraphTransformer( transformer );
|
||||
|
||||
DefaultArtifactTypeRegistry stereotypes = new DefaultArtifactTypeRegistry();
|
||||
stereotypes.add( new DefaultArtifactType( "pom" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "maven-plugin", "jar", "", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "jar", "jar", "", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "ejb", "jar", "", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "ejb-client", "jar", "client", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "test-jar", "jar", "tests", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "javadoc", "jar", "javadoc", "java" ) );
|
||||
stereotypes.add( new DefaultArtifactType( "java-source", "jar", "sources", "java", false, false ) );
|
||||
stereotypes.add( new DefaultArtifactType( "war", "war", "", "java", false, true ) );
|
||||
stereotypes.add( new DefaultArtifactType( "ear", "ear", "", "java", false, true ) );
|
||||
stereotypes.add( new DefaultArtifactType( "rar", "rar", "", "java", false, true ) );
|
||||
stereotypes.add( new DefaultArtifactType( "par", "par", "", "java", false, true ) );
|
||||
session.setArtifactTypeRegistry( stereotypes );
|
||||
|
||||
session.setIgnoreInvalidArtifactDescriptor( true );
|
||||
session.setIgnoreMissingArtifactDescriptor( true );
|
||||
|
||||
Properties sysProps = System.getProperties();
|
||||
session.setSystemProps( sysProps );
|
||||
session.setConfigProps( sysProps );
|
||||
|
||||
return session;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
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 );
|
||||
}
|
||||
|
||||
}
|
|
@ -22,8 +22,8 @@ package org.apache.maven.repository.internal;
|
|||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.util.artifact.AbstractArtifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.util.artifact.AbstractArtifact;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.apache.maven.artifact.repository.metadata.Metadata;
|
|||
import org.apache.maven.artifact.repository.metadata.Snapshot;
|
||||
import org.apache.maven.artifact.repository.metadata.SnapshotVersion;
|
||||
import org.apache.maven.artifact.repository.metadata.Versioning;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -24,12 +24,12 @@ import java.util.Collections;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sonatype.aether.ConfigurationProperties;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.deployment.DeployRequest;
|
||||
import org.sonatype.aether.impl.MetadataGenerator;
|
||||
import org.sonatype.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.deployment.DeployRequest;
|
||||
import org.eclipse.aether.impl.MetadataGenerator;
|
||||
import org.eclipse.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.util.ConfigUtils;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
@ -44,7 +44,7 @@ class RemoteSnapshotMetadataGenerator
|
|||
|
||||
public RemoteSnapshotMetadataGenerator( RepositorySystemSession session, DeployRequest request )
|
||||
{
|
||||
legacyFormat = ConfigurationProperties.get( session.getConfigProperties(), "maven.metadata.legacy", false );
|
||||
legacyFormat = ConfigUtils.getBoolean( session.getConfigProperties(), false, "maven.metadata.legacy" );
|
||||
|
||||
snapshots = new LinkedHashMap<Object, RemoteSnapshotMetadata>();
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ package org.apache.maven.repository.internal;
|
|||
*/
|
||||
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.deployment.DeployRequest;
|
||||
import org.sonatype.aether.impl.MetadataGenerator;
|
||||
import org.sonatype.aether.impl.MetadataGeneratorFactory;
|
||||
import org.sonatype.aether.installation.InstallRequest;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.deployment.DeployRequest;
|
||||
import org.eclipse.aether.impl.MetadataGenerator;
|
||||
import org.eclipse.aether.impl.MetadataGeneratorFactory;
|
||||
import org.eclipse.aether.installation.InstallRequest;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
@ -44,7 +44,7 @@ public class SnapshotMetadataGeneratorFactory
|
|||
return new RemoteSnapshotMetadataGenerator( session, request );
|
||||
}
|
||||
|
||||
public int getPriority()
|
||||
public float getPriority()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
|
|
@ -26,8 +26,8 @@ import java.util.LinkedHashSet;
|
|||
|
||||
import org.apache.maven.artifact.repository.metadata.Metadata;
|
||||
import org.apache.maven.artifact.repository.metadata.Versioning;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.util.artifact.ArtifactProperties;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.ArtifactProperties;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -25,12 +25,12 @@ import java.util.Iterator;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.deployment.DeployRequest;
|
||||
import org.sonatype.aether.impl.MetadataGenerator;
|
||||
import org.sonatype.aether.installation.InstallRequest;
|
||||
import org.sonatype.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.deployment.DeployRequest;
|
||||
import org.eclipse.aether.impl.MetadataGenerator;
|
||||
import org.eclipse.aether.installation.InstallRequest;
|
||||
import org.eclipse.aether.metadata.Metadata;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -20,11 +20,11 @@ package org.apache.maven.repository.internal;
|
|||
*/
|
||||
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.deployment.DeployRequest;
|
||||
import org.sonatype.aether.impl.MetadataGenerator;
|
||||
import org.sonatype.aether.impl.MetadataGeneratorFactory;
|
||||
import org.sonatype.aether.installation.InstallRequest;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.deployment.DeployRequest;
|
||||
import org.eclipse.aether.impl.MetadataGenerator;
|
||||
import org.eclipse.aether.impl.MetadataGeneratorFactory;
|
||||
import org.eclipse.aether.installation.InstallRequest;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
@ -44,7 +44,7 @@ public class VersionsMetadataGeneratorFactory
|
|||
return new VersionsMetadataGenerator( session, request );
|
||||
}
|
||||
|
||||
public int getPriority()
|
||||
public float getPriority()
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
|
|
@ -19,26 +19,26 @@ package org.apache.maven.repository.internal;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.impl.MetadataGeneratorFactory;
|
||||
import org.sonatype.aether.spi.locator.ServiceLocator;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.impl.MetadataGeneratorFactory;
|
||||
import org.eclipse.aether.spi.locator.ServiceLocator;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class DefaultServiceLocatorTest
|
||||
public class MavenRepositorySystemUtilsTest
|
||||
extends TestCase
|
||||
{
|
||||
|
||||
public void testGetRepositorySystem()
|
||||
{
|
||||
ServiceLocator locator = new MavenServiceLocator();
|
||||
ServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
|
||||
RepositorySystem repoSys = locator.getService( RepositorySystem.class );
|
||||
assertNotNull( repoSys );
|
||||
}
|
||||
|
||||
public void testGetMetadataGeneratorFactories()
|
||||
{
|
||||
ServiceLocator locator = new MavenServiceLocator();
|
||||
ServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
|
||||
assertEquals( 2, locator.getServices( MetadataGeneratorFactory.class ).size() );
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-connector-wagon</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
|
|
@ -37,15 +37,15 @@ import org.apache.maven.project.artifact.ProjectArtifactMetadata;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.deployment.DeployRequest;
|
||||
import org.sonatype.aether.deployment.DeployResult;
|
||||
import org.sonatype.aether.deployment.DeploymentException;
|
||||
import org.sonatype.aether.metadata.MergeableMetadata;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.artifact.SubArtifact;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.deployment.DeployRequest;
|
||||
import org.eclipse.aether.deployment.DeployResult;
|
||||
import org.eclipse.aether.deployment.DeploymentException;
|
||||
import org.eclipse.aether.metadata.MergeableMetadata;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.artifact.SubArtifact;
|
||||
|
||||
@Component( role = ArtifactDeployer.class, instantiationStrategy = "per-lookup" )
|
||||
public class DefaultArtifactDeployer
|
||||
|
@ -86,7 +86,7 @@ public class DefaultArtifactDeployer
|
|||
|
||||
request.setTrace( DefaultRequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) );
|
||||
|
||||
org.sonatype.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact );
|
||||
org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact );
|
||||
mainArtifact = mainArtifact.setFile( source );
|
||||
request.addArtifact( mainArtifact );
|
||||
|
||||
|
@ -103,7 +103,7 @@ public class DefaultArtifactDeployer
|
|||
{
|
||||
if ( metadata instanceof ProjectArtifactMetadata )
|
||||
{
|
||||
org.sonatype.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
|
||||
org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
|
||||
pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() );
|
||||
request.addArtifact( pomArtifact );
|
||||
}
|
||||
|
|
|
@ -36,12 +36,12 @@ import org.apache.maven.project.artifact.ProjectArtifactMetadata;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.installation.InstallRequest;
|
||||
import org.sonatype.aether.installation.InstallationException;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.artifact.SubArtifact;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.installation.InstallRequest;
|
||||
import org.eclipse.aether.installation.InstallationException;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.artifact.SubArtifact;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
@ -79,7 +79,7 @@ public class DefaultArtifactInstaller
|
|||
|
||||
request.setTrace( DefaultRequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) );
|
||||
|
||||
org.sonatype.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact );
|
||||
org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact );
|
||||
mainArtifact = mainArtifact.setFile( source );
|
||||
request.addArtifact( mainArtifact );
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class DefaultArtifactInstaller
|
|||
{
|
||||
if ( metadata instanceof ProjectArtifactMetadata )
|
||||
{
|
||||
org.sonatype.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
|
||||
org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
|
||||
pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() );
|
||||
request.addArtifact( pomArtifact );
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.maven.plugin.LegacySupport;
|
|||
import org.apache.maven.repository.RepositorySystem;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
|
||||
/**
|
||||
* @author jdcasey
|
||||
|
|
|
@ -26,8 +26,8 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
|
|||
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
|
||||
import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
|
||||
import org.codehaus.plexus.util.FileUtils;
|
||||
import org.sonatype.aether.RepositoryException;
|
||||
import org.sonatype.aether.metadata.MergeableMetadata;
|
||||
import org.eclipse.aether.RepositoryException;
|
||||
import org.eclipse.aether.metadata.MergeableMetadata;
|
||||
|
||||
/**
|
||||
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
|
||||
|
|
|
@ -56,11 +56,11 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.LocalRepositoryManager;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResult;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.LocalRepositoryManager;
|
||||
import org.eclipse.aether.resolution.ArtifactRequest;
|
||||
import org.eclipse.aether.resolution.ArtifactResult;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
@ -212,9 +212,9 @@ public class DefaultArtifactResolver
|
|||
|
||||
result = repoSystem.resolveArtifact( session, artifactRequest );
|
||||
}
|
||||
catch ( org.sonatype.aether.resolution.ArtifactResolutionException e )
|
||||
catch ( org.eclipse.aether.resolution.ArtifactResolutionException e )
|
||||
{
|
||||
if ( e.getCause() instanceof org.sonatype.aether.transfer.ArtifactNotFoundException )
|
||||
if ( e.getCause() instanceof org.eclipse.aether.transfer.ArtifactNotFoundException )
|
||||
{
|
||||
throw new ArtifactNotFoundException( e.getMessage(), artifact, remoteRepositories, e );
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.maven.plugin.LegacySupport;
|
|||
import org.apache.maven.repository.RepositorySystem;
|
||||
import org.codehaus.plexus.PlexusContainer;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
|
||||
// This class needs to stick around because it was exposed the the remote resources plugin started using it instead of
|
||||
// getting the repositories from the project.
|
||||
|
|
|
@ -73,10 +73,10 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.AuthenticationSelector;
|
||||
import org.sonatype.aether.repository.ProxySelector;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.AuthenticationSelector;
|
||||
import org.eclipse.aether.repository.ProxySelector;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
@ -478,7 +478,7 @@ public class LegacyRepositorySystem
|
|||
{
|
||||
if ( session != null )
|
||||
{
|
||||
org.sonatype.aether.repository.MirrorSelector selector = session.getMirrorSelector();
|
||||
org.eclipse.aether.repository.MirrorSelector selector = session.getMirrorSelector();
|
||||
if ( selector != null )
|
||||
{
|
||||
RemoteRepository repo = selector.getMirror( RepositoryUtils.toRepo( repository ) );
|
||||
|
@ -583,7 +583,7 @@ public class LegacyRepositorySystem
|
|||
AuthenticationSelector selector = session.getAuthenticationSelector();
|
||||
if ( selector != null )
|
||||
{
|
||||
org.sonatype.aether.repository.Authentication auth =
|
||||
org.eclipse.aether.repository.Authentication auth =
|
||||
selector.getAuthentication( RepositoryUtils.toRepo( repository ) );
|
||||
if ( auth != null )
|
||||
{
|
||||
|
@ -688,7 +688,7 @@ public class LegacyRepositorySystem
|
|||
ProxySelector selector = session.getProxySelector();
|
||||
if ( selector != null )
|
||||
{
|
||||
org.sonatype.aether.repository.Proxy proxy = selector.getProxy( RepositoryUtils.toRepo( repository ) );
|
||||
org.eclipse.aether.repository.Proxy proxy = selector.getProxy( RepositoryUtils.toRepo( repository ) );
|
||||
if ( proxy != null )
|
||||
{
|
||||
Proxy p = new Proxy();
|
||||
|
|
|
@ -36,26 +36,27 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
|
|||
import org.apache.maven.execution.DefaultMavenExecutionRequest;
|
||||
import org.apache.maven.execution.DefaultMavenExecutionResult;
|
||||
import org.apache.maven.execution.MavenSession;
|
||||
import org.codehaus.plexus.ContainerConfiguration;
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.collection.DependencyGraphTransformer;
|
||||
import org.sonatype.aether.collection.DependencyManager;
|
||||
import org.sonatype.aether.collection.DependencySelector;
|
||||
import org.sonatype.aether.collection.DependencyTraverser;
|
||||
import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.util.DefaultRepositorySystemSession;
|
||||
import org.sonatype.aether.util.graph.manager.ClassicDependencyManager;
|
||||
import org.sonatype.aether.util.graph.selector.AndDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.ExclusionDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.OptionalDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.ScopeDependencySelector;
|
||||
import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
|
||||
import org.sonatype.aether.util.graph.transformer.NearestVersionConflictResolver;
|
||||
import org.sonatype.aether.util.graph.transformer.ConflictMarker;
|
||||
import org.sonatype.aether.util.graph.transformer.JavaDependencyContextRefiner;
|
||||
import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
|
||||
import org.sonatype.aether.util.graph.traverser.FatArtifactTraverser;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.collection.DependencyGraphTransformer;
|
||||
import org.eclipse.aether.collection.DependencyManager;
|
||||
import org.eclipse.aether.collection.DependencySelector;
|
||||
import org.eclipse.aether.collection.DependencyTraverser;
|
||||
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.util.DefaultRepositorySystemSession;
|
||||
import org.eclipse.aether.util.graph.manager.ClassicDependencyManager;
|
||||
import org.eclipse.aether.util.graph.selector.AndDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.OptionalDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.ScopeDependencySelector;
|
||||
import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
|
||||
import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver;
|
||||
import org.eclipse.aether.util.graph.transformer.ConflictMarker;
|
||||
import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner;
|
||||
import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
|
||||
import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
|
||||
|
@ -67,6 +68,13 @@ public abstract class AbstractArtifactComponentTestCase
|
|||
|
||||
protected ArtifactRepositoryFactory artifactRepositoryFactory;
|
||||
|
||||
@Override
|
||||
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
|
||||
{
|
||||
super.customizeContainerConfiguration( containerConfiguration );
|
||||
containerConfiguration.setAutoWiring( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
|
@ -350,7 +358,8 @@ public abstract class AbstractArtifactComponentTestCase
|
|||
new JavaDependencyContextRefiner() );
|
||||
session.setDependencyGraphTransformer( transformer );
|
||||
|
||||
session.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepository().getBasedir() ) );
|
||||
LocalRepository localRepo = new LocalRepository( localRepository().getBasedir() );
|
||||
session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( localRepo ) );
|
||||
|
||||
return session;
|
||||
}
|
||||
|
|
|
@ -27,8 +27,10 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
|
|||
import org.apache.maven.model.building.ModelBuildingException;
|
||||
import org.apache.maven.model.building.ModelProblem;
|
||||
import org.apache.maven.repository.RepositorySystem;
|
||||
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
|
||||
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
||||
import org.codehaus.plexus.ContainerConfiguration;
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
import org.eclipse.aether.util.DefaultRepositorySystemSession;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
@ -40,6 +42,13 @@ public abstract class AbstractMavenProjectTestCase
|
|||
|
||||
protected RepositorySystem repositorySystem;
|
||||
|
||||
@Override
|
||||
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
|
||||
{
|
||||
super.customizeContainerConfiguration( containerConfiguration );
|
||||
containerConfiguration.setAutoWiring( true );
|
||||
}
|
||||
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
|
@ -166,7 +175,7 @@ public abstract class AbstractMavenProjectTestCase
|
|||
protected void initRepoSession( ProjectBuildingRequest request )
|
||||
{
|
||||
File localRepo = new File( request.getLocalRepository().getBasedir() );
|
||||
MavenRepositorySystemSession session = new MavenRepositorySystemSession();
|
||||
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
|
||||
session.setLocalRepositoryManager( new LegacyLocalRepositoryManager( localRepo ) );
|
||||
request.setRepositorySession( session );
|
||||
}
|
||||
|
|
|
@ -26,13 +26,13 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.impl.ArtifactResolver;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.resolution.ArtifactResult;
|
||||
import org.sonatype.aether.transfer.ArtifactNotFoundException;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.impl.ArtifactResolver;
|
||||
import org.eclipse.aether.resolution.ArtifactRequest;
|
||||
import org.eclipse.aether.resolution.ArtifactResolutionException;
|
||||
import org.eclipse.aether.resolution.ArtifactResult;
|
||||
import org.eclipse.aether.transfer.ArtifactNotFoundException;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -21,22 +21,36 @@ package org.apache.maven.project;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
|
||||
import org.sonatype.aether.repository.LocalArtifactRequest;
|
||||
import org.sonatype.aether.repository.LocalArtifactResult;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.repository.LocalArtifactRegistration;
|
||||
import org.eclipse.aether.repository.LocalArtifactRequest;
|
||||
import org.eclipse.aether.repository.LocalArtifactResult;
|
||||
import org.eclipse.aether.repository.LocalMetadataRegistration;
|
||||
import org.eclipse.aether.repository.LocalMetadataRequest;
|
||||
import org.eclipse.aether.repository.LocalMetadataResult;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.LocalRepositoryManager;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
*/
|
||||
public class LegacyLocalRepositoryManager
|
||||
extends SimpleLocalRepositoryManager
|
||||
implements LocalRepositoryManager
|
||||
{
|
||||
|
||||
private final LocalRepository repository;
|
||||
|
||||
public LegacyLocalRepositoryManager( File basedir )
|
||||
{
|
||||
super( basedir );
|
||||
this.repository = new LocalRepository( basedir.getAbsoluteFile(), "legacy" );
|
||||
}
|
||||
|
||||
public LocalRepository getRepository()
|
||||
{
|
||||
return repository;
|
||||
}
|
||||
|
||||
public String getPathForLocalArtifact( Artifact artifact )
|
||||
|
@ -59,17 +73,121 @@ public class LegacyLocalRepositoryManager
|
|||
return path.toString();
|
||||
}
|
||||
|
||||
public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context )
|
||||
{
|
||||
return getPathForLocalArtifact( artifact );
|
||||
}
|
||||
|
||||
public String getPathForLocalMetadata( Metadata metadata )
|
||||
{
|
||||
return getPath( metadata, "local" );
|
||||
}
|
||||
|
||||
public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context )
|
||||
{
|
||||
return getPath( metadata, getRepositoryKey( repository, context ) );
|
||||
}
|
||||
|
||||
String getRepositoryKey( RemoteRepository repository, String context )
|
||||
{
|
||||
return repository.getId();
|
||||
}
|
||||
|
||||
private String getPath( Metadata metadata, String repositoryKey )
|
||||
{
|
||||
StringBuilder path = new StringBuilder( 128 );
|
||||
|
||||
if ( metadata.getGroupId().length() > 0 )
|
||||
{
|
||||
path.append( metadata.getGroupId().replace( '.', '/' ) ).append( '/' );
|
||||
|
||||
if ( metadata.getArtifactId().length() > 0 )
|
||||
{
|
||||
path.append( metadata.getArtifactId() ).append( '/' );
|
||||
|
||||
if ( metadata.getVersion().length() > 0 )
|
||||
{
|
||||
path.append( metadata.getVersion() ).append( '/' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
path.append( insertRepositoryKey( metadata.getType(), repositoryKey ) );
|
||||
|
||||
return path.toString();
|
||||
}
|
||||
|
||||
private String insertRepositoryKey( String filename, String repositoryKey )
|
||||
{
|
||||
String result;
|
||||
int idx = filename.indexOf( '.' );
|
||||
if ( idx < 0 )
|
||||
{
|
||||
result = filename + '-' + repositoryKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = filename.substring( 0, idx ) + '-' + repositoryKey + filename.substring( idx );
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request )
|
||||
{
|
||||
String path = getPathForLocalArtifact( request.getArtifact() );
|
||||
File file = new File( getRepository().getBasedir(), path );
|
||||
String path = getPathForLocalArtifact( request.getArtifact() );
|
||||
File file = new File( getRepository().getBasedir(), path );
|
||||
|
||||
LocalArtifactResult result = new LocalArtifactResult( request );
|
||||
if ( file.isFile() )
|
||||
if ( file.isFile() )
|
||||
{
|
||||
result.setFile( file );
|
||||
result.setAvailable( true );
|
||||
}
|
||||
return result;
|
||||
}
|
||||
result.setFile( file );
|
||||
result.setAvailable( true );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void add( RepositorySystemSession session, LocalArtifactRegistration request )
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request )
|
||||
{
|
||||
LocalMetadataResult result = new LocalMetadataResult( request );
|
||||
|
||||
String path;
|
||||
|
||||
Metadata metadata = request.getMetadata();
|
||||
String context = request.getContext();
|
||||
RemoteRepository remote = request.getRepository();
|
||||
|
||||
if ( remote != null )
|
||||
{
|
||||
path = getPathForRemoteMetadata( metadata, remote, context );
|
||||
}
|
||||
else
|
||||
{
|
||||
path = getPathForLocalMetadata( metadata );
|
||||
}
|
||||
|
||||
File file = new File( getRepository().getBasedir(), path );
|
||||
if ( file.isFile() )
|
||||
{
|
||||
result.setFile( file );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void add( RepositorySystemSession session, LocalMetadataRegistration request )
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return String.valueOf( getRepository() );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ import java.util.Iterator;
|
|||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.repository.RepositorySystem;
|
||||
import org.apache.maven.repository.internal.DefaultArtifactDescriptorReader;
|
||||
import org.sonatype.aether.impl.ArtifactDescriptorReader;
|
||||
import org.sonatype.aether.impl.ArtifactResolver;
|
||||
import org.eclipse.aether.impl.ArtifactDescriptorReader;
|
||||
import org.eclipse.aether.impl.ArtifactResolver;
|
||||
|
||||
public class ProjectClasspathTest
|
||||
extends AbstractMavenProjectTestCase
|
||||
|
|
|
@ -32,9 +32,11 @@ import org.apache.maven.model.Repository;
|
|||
import org.apache.maven.model.RepositoryPolicy;
|
||||
import org.apache.maven.plugin.LegacySupport;
|
||||
import org.apache.maven.repository.RepositorySystem;
|
||||
import org.codehaus.plexus.ContainerConfiguration;
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
|
||||
import org.sonatype.aether.util.DefaultRepositorySystemSession;
|
||||
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.util.DefaultRepositorySystemSession;
|
||||
|
||||
/**
|
||||
* Tests {@link LegacyRepositorySystem}.
|
||||
|
@ -48,6 +50,13 @@ public class LegacyRepositorySystemTest
|
|||
|
||||
private ResolutionErrorHandler resolutionErrorHandler;
|
||||
|
||||
@Override
|
||||
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
|
||||
{
|
||||
super.customizeContainerConfiguration( containerConfiguration );
|
||||
containerConfiguration.setAutoWiring( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
|
@ -114,7 +123,8 @@ public class LegacyRepositorySystemTest
|
|||
.setLocalRepository( getLocalRepository() );
|
||||
|
||||
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
|
||||
session.setLocalRepositoryManager( new SimpleLocalRepositoryManager( request.getLocalRepository().getBasedir() ) );
|
||||
LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() );
|
||||
session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( localRepo ) );
|
||||
LegacySupport legacySupport = lookup( LegacySupport.class );
|
||||
legacySupport.setSession( new MavenSession( getContainer(), session, new DefaultMavenExecutionRequest(),
|
||||
new DefaultMavenExecutionResult() ) );
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
|
|||
import org.apache.maven.artifact.repository.Authentication;
|
||||
import org.apache.maven.repository.RepositorySystem;
|
||||
import org.apache.maven.settings.Server;
|
||||
import org.codehaus.plexus.ContainerConfiguration;
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
|
||||
/**
|
||||
|
@ -34,6 +35,13 @@ public class LegacyRepositorySystemTest
|
|||
{
|
||||
private RepositorySystem repositorySystem;
|
||||
|
||||
@Override
|
||||
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
|
||||
{
|
||||
super.customizeContainerConfiguration( containerConfiguration );
|
||||
containerConfiguration.setAutoWiring( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
|
|
|
@ -61,7 +61,7 @@ under the License.
|
|||
<field-name>legacySupport</field-name>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.sonatype.aether.RepositorySystem</role>
|
||||
<role>org.eclipse.aether.RepositorySystem</role>
|
||||
<role-hint>default</role-hint>
|
||||
<field-name>repoSystem</field-name>
|
||||
</requirement>
|
||||
|
|
|
@ -59,17 +59,17 @@
|
|||
<artifactId>maven-aether-provider</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-impl</artifactId>
|
||||
<version>${aetherVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-api</artifactId>
|
||||
<version>${aetherVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.aether</groupId>
|
||||
<groupId>org.eclipse.aether</groupId>
|
||||
<artifactId>aether-util</artifactId>
|
||||
<version>${aetherVersion}</version>
|
||||
</dependency>
|
||||
|
|
|
@ -75,33 +75,33 @@ import org.codehaus.plexus.util.IOUtil;
|
|||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.dag.CycleDetectedException;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
import org.sonatype.aether.ConfigurationProperties;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.collection.DependencyGraphTransformer;
|
||||
import org.sonatype.aether.collection.DependencyManager;
|
||||
import org.sonatype.aether.collection.DependencySelector;
|
||||
import org.sonatype.aether.collection.DependencyTraverser;
|
||||
import org.sonatype.aether.repository.Authentication;
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.repository.RepositoryPolicy;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.util.DefaultRepositorySystemSession;
|
||||
import org.sonatype.aether.util.graph.manager.ClassicDependencyManager;
|
||||
import org.sonatype.aether.util.graph.selector.AndDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.ExclusionDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.OptionalDependencySelector;
|
||||
import org.sonatype.aether.util.graph.selector.ScopeDependencySelector;
|
||||
import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
|
||||
import org.sonatype.aether.util.graph.transformer.NearestVersionConflictResolver;
|
||||
import org.sonatype.aether.util.graph.transformer.ConflictMarker;
|
||||
import org.sonatype.aether.util.graph.transformer.JavaDependencyContextRefiner;
|
||||
import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
|
||||
import org.sonatype.aether.util.graph.traverser.FatArtifactTraverser;
|
||||
import org.sonatype.aether.util.repository.ChainedWorkspaceReader;
|
||||
import org.sonatype.aether.util.repository.DefaultAuthenticationSelector;
|
||||
import org.sonatype.aether.util.repository.DefaultMirrorSelector;
|
||||
import org.sonatype.aether.util.repository.DefaultProxySelector;
|
||||
import org.eclipse.aether.ConfigurationProperties;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.collection.DependencyGraphTransformer;
|
||||
import org.eclipse.aether.collection.DependencyManager;
|
||||
import org.eclipse.aether.collection.DependencySelector;
|
||||
import org.eclipse.aether.collection.DependencyTraverser;
|
||||
import org.eclipse.aether.repository.Authentication;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.RepositoryPolicy;
|
||||
import org.eclipse.aether.repository.WorkspaceReader;
|
||||
import org.eclipse.aether.util.DefaultRepositorySystemSession;
|
||||
import org.eclipse.aether.util.graph.manager.ClassicDependencyManager;
|
||||
import org.eclipse.aether.util.graph.selector.AndDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.OptionalDependencySelector;
|
||||
import org.eclipse.aether.util.graph.selector.ScopeDependencySelector;
|
||||
import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
|
||||
import org.eclipse.aether.util.graph.transformer.NearestVersionConflictResolver;
|
||||
import org.eclipse.aether.util.graph.transformer.ConflictMarker;
|
||||
import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner;
|
||||
import org.eclipse.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
|
||||
import org.eclipse.aether.util.graph.traverser.FatArtifactTraverser;
|
||||
import org.eclipse.aether.util.repository.ChainedWorkspaceReader;
|
||||
import org.eclipse.aether.util.repository.DefaultAuthenticationSelector;
|
||||
import org.eclipse.aether.util.repository.DefaultMirrorSelector;
|
||||
import org.eclipse.aether.util.repository.DefaultProxySelector;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
@ -400,7 +400,7 @@ public class DefaultMaven
|
|||
for ( Proxy proxy : decrypted.getProxies() )
|
||||
{
|
||||
Authentication proxyAuth = new Authentication( proxy.getUsername(), proxy.getPassword() );
|
||||
proxySelector.add( new org.sonatype.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(),
|
||||
proxySelector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(),
|
||||
proxyAuth ), proxy.getNonProxyHosts() );
|
||||
}
|
||||
session.setProxySelector( proxySelector );
|
||||
|
|
|
@ -22,9 +22,9 @@ package org.apache.maven;
|
|||
import java.io.FileNotFoundException;
|
||||
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.AbstractRepositoryListener;
|
||||
import org.sonatype.aether.RepositoryEvent;
|
||||
import org.sonatype.aether.transfer.MetadataNotFoundException;
|
||||
import org.eclipse.aether.AbstractRepositoryListener;
|
||||
import org.eclipse.aether.RepositoryEvent;
|
||||
import org.eclipse.aether.transfer.MetadataNotFoundException;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -21,9 +21,9 @@ package org.apache.maven;
|
|||
|
||||
import org.apache.maven.artifact.ArtifactUtils;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.repository.WorkspaceRepository;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.repository.WorkspaceReader;
|
||||
import org.eclipse.aether.repository.WorkspaceRepository;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -30,20 +30,20 @@ import org.apache.maven.artifact.handler.DefaultArtifactHandler;
|
|||
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.artifact.ArtifactType;
|
||||
import org.sonatype.aether.artifact.ArtifactTypeRegistry;
|
||||
import org.sonatype.aether.graph.Dependency;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.sonatype.aether.graph.Exclusion;
|
||||
import org.sonatype.aether.repository.Authentication;
|
||||
import org.sonatype.aether.repository.Proxy;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.RepositoryPolicy;
|
||||
import org.sonatype.aether.util.artifact.ArtifactProperties;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifactType;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.ArtifactProperties;
|
||||
import org.eclipse.aether.artifact.ArtifactType;
|
||||
import org.eclipse.aether.artifact.ArtifactTypeRegistry;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.graph.Exclusion;
|
||||
import org.eclipse.aether.repository.Authentication;
|
||||
import org.eclipse.aether.repository.Proxy;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.RepositoryPolicy;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifactType;
|
||||
|
||||
/**
|
||||
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
|
||||
|
|
|
@ -29,21 +29,20 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
|
|||
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
|
||||
import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException;
|
||||
import org.apache.maven.repository.Proxy;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.metadata.Metadata;
|
||||
import org.sonatype.aether.repository.LocalArtifactRegistration;
|
||||
import org.sonatype.aether.repository.LocalArtifactRequest;
|
||||
import org.sonatype.aether.repository.LocalArtifactResult;
|
||||
import org.sonatype.aether.repository.LocalMetadataRegistration;
|
||||
import org.sonatype.aether.repository.LocalMetadataRequest;
|
||||
import org.sonatype.aether.repository.LocalMetadataResult;
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.repository.LocalRepositoryManager;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.util.DefaultRepositorySystemSession;
|
||||
import org.sonatype.aether.util.FilterRepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.metadata.Metadata;
|
||||
import org.eclipse.aether.repository.LocalArtifactRegistration;
|
||||
import org.eclipse.aether.repository.LocalArtifactRequest;
|
||||
import org.eclipse.aether.repository.LocalArtifactResult;
|
||||
import org.eclipse.aether.repository.LocalMetadataRegistration;
|
||||
import org.eclipse.aether.repository.LocalMetadataRequest;
|
||||
import org.eclipse.aether.repository.LocalMetadataResult;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.LocalRepositoryManager;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.util.DefaultRepositorySystemSession;
|
||||
|
||||
/**
|
||||
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
|
||||
|
@ -84,14 +83,7 @@ public class LegacyLocalRepositoryManager
|
|||
|
||||
final LocalRepositoryManager llrm = new LegacyLocalRepositoryManager( repository );
|
||||
|
||||
return new FilterRepositorySystemSession( session )
|
||||
{
|
||||
@Override
|
||||
public LocalRepositoryManager getLocalRepositoryManager()
|
||||
{
|
||||
return llrm;
|
||||
}
|
||||
};
|
||||
return new DefaultRepositorySystemSession( session ).setLocalRepositoryManager( llrm );
|
||||
}
|
||||
|
||||
private LegacyLocalRepositoryManager( ArtifactRepository delegate )
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.maven.classrealm;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.Map;
|
|||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
|
||||
/**
|
||||
* Manages the class realms used by Maven. <strong>Warning:</strong> This is an internal utility interface that is only
|
||||
|
|
|
@ -45,7 +45,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
|
||||
/**
|
||||
* Manages the class realms used by Maven. <strong>Warning:</strong> This is an internal utility class that is only
|
||||
|
@ -163,19 +163,19 @@ public class DefaultClassRealmManager
|
|||
imports.put( "org.apache.maven.wagon.resource", coreRealm );
|
||||
|
||||
// aether-api, aether-spi, aether-impl
|
||||
imports.put( "org.sonatype.aether.*", coreRealm );
|
||||
imports.put( "org.sonatype.aether.artifact", coreRealm );
|
||||
imports.put( "org.sonatype.aether.collection", coreRealm );
|
||||
imports.put( "org.sonatype.aether.deployment", coreRealm );
|
||||
imports.put( "org.sonatype.aether.graph", coreRealm );
|
||||
imports.put( "org.sonatype.aether.impl", coreRealm );
|
||||
imports.put( "org.sonatype.aether.installation", coreRealm );
|
||||
imports.put( "org.sonatype.aether.metadata", coreRealm );
|
||||
imports.put( "org.sonatype.aether.repository", coreRealm );
|
||||
imports.put( "org.sonatype.aether.resolution", coreRealm );
|
||||
imports.put( "org.sonatype.aether.spi", coreRealm );
|
||||
imports.put( "org.sonatype.aether.transfer", coreRealm );
|
||||
imports.put( "org.sonatype.aether.version", coreRealm );
|
||||
imports.put( "org.eclipse.aether.*", coreRealm );
|
||||
imports.put( "org.eclipse.aether.artifact", coreRealm );
|
||||
imports.put( "org.eclipse.aether.collection", coreRealm );
|
||||
imports.put( "org.eclipse.aether.deployment", coreRealm );
|
||||
imports.put( "org.eclipse.aether.graph", coreRealm );
|
||||
imports.put( "org.eclipse.aether.impl", coreRealm );
|
||||
imports.put( "org.eclipse.aether.installation", coreRealm );
|
||||
imports.put( "org.eclipse.aether.metadata", coreRealm );
|
||||
imports.put( "org.eclipse.aether.repository", coreRealm );
|
||||
imports.put( "org.eclipse.aether.resolution", coreRealm );
|
||||
imports.put( "org.eclipse.aether.spi", coreRealm );
|
||||
imports.put( "org.eclipse.aether.transfer", coreRealm );
|
||||
imports.put( "org.eclipse.aether.version", coreRealm );
|
||||
|
||||
// plexus-classworlds
|
||||
imports.put( "org.codehaus.plexus.classworlds", coreRealm );
|
||||
|
|
|
@ -62,7 +62,7 @@ public interface EventSpy
|
|||
* @see org.apache.maven.project.DependencyResolutionRequest
|
||||
* @see org.apache.maven.project.DependencyResolutionResultt
|
||||
* @see org.apache.maven.execution.ExecutionEvent
|
||||
* @see org.sonatype.aether.RepositoryEvent
|
||||
* @see org.eclipse.aether.RepositoryEvent
|
||||
*/
|
||||
void onEvent( Object event )
|
||||
throws Exception;
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.maven.execution.ExecutionListener;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.eclipse.aether.RepositoryListener;
|
||||
|
||||
/**
|
||||
* Dispatches callbacks to all registered eventspies.
|
||||
|
|
|
@ -19,9 +19,9 @@ package org.apache.maven.eventspy.internal;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.sonatype.aether.AbstractRepositoryListener;
|
||||
import org.sonatype.aether.RepositoryEvent;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.eclipse.aether.AbstractRepositoryListener;
|
||||
import org.eclipse.aether.RepositoryEvent;
|
||||
import org.eclipse.aether.RepositoryListener;
|
||||
|
||||
/**
|
||||
* Forwards repository events to eventspies.
|
||||
|
|
|
@ -32,10 +32,10 @@ import org.apache.maven.project.ProjectBuildingRequest;
|
|||
import org.apache.maven.settings.Mirror;
|
||||
import org.apache.maven.settings.Proxy;
|
||||
import org.apache.maven.settings.Server;
|
||||
import org.sonatype.aether.RepositoryCache;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.transfer.TransferListener;
|
||||
import org.sonatype.aether.util.DefaultRepositoryCache;
|
||||
import org.eclipse.aether.RepositoryCache;
|
||||
import org.eclipse.aether.repository.WorkspaceReader;
|
||||
import org.eclipse.aether.transfer.TransferListener;
|
||||
import org.eclipse.aether.util.DefaultRepositoryCache;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
|
|
@ -32,9 +32,9 @@ import org.apache.maven.settings.Mirror;
|
|||
import org.apache.maven.settings.Proxy;
|
||||
import org.apache.maven.settings.Server;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.RepositoryCache;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.transfer.TransferListener;
|
||||
import org.eclipse.aether.RepositoryCache;
|
||||
import org.eclipse.aether.repository.WorkspaceReader;
|
||||
import org.eclipse.aether.transfer.TransferListener;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.apache.maven.project.ProjectBuildingRequest;
|
|||
import org.apache.maven.settings.Settings;
|
||||
import org.codehaus.plexus.PlexusContainer;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
|
|
@ -31,11 +31,11 @@ import org.apache.maven.project.artifact.InvalidDependencyVersionException;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.graph.Dependency;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.sonatype.aether.util.filter.AndDependencyFilter;
|
||||
import org.sonatype.aether.util.filter.ScopeDependencyFilter;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.util.filter.AndDependencyFilter;
|
||||
import org.eclipse.aether.util.filter.ScopeDependencyFilter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -228,7 +228,7 @@ public class LifecycleDependencyResolver
|
|||
|
||||
for ( Dependency dependency : dependencies )
|
||||
{
|
||||
org.sonatype.aether.artifact.Artifact a = dependency.getArtifact();
|
||||
org.eclipse.aether.artifact.Artifact a = dependency.getArtifact();
|
||||
String key = ArtifactUtils.key( a.getGroupId(), a.getArtifactId(), a.getVersion() );
|
||||
if ( !projectKeys.contains( key ) )
|
||||
{
|
||||
|
@ -310,7 +310,7 @@ public class LifecycleDependencyResolver
|
|||
Dependency dependency = node.getDependency();
|
||||
if ( dependency != null )
|
||||
{
|
||||
org.sonatype.aether.artifact.Artifact a = dependency.getArtifact();
|
||||
org.eclipse.aether.artifact.Artifact a = dependency.getArtifact();
|
||||
String key = ArtifactUtils.key( a.getGroupId(), a.getArtifactId(), a.getVersion() );
|
||||
return !keys.contains( key );
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ import org.apache.maven.model.Plugin;
|
|||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* @author Jason van Zyl
|
||||
|
|
|
@ -25,11 +25,11 @@ import java.util.List;
|
|||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.model.Exclusion;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.RepositoryPolicy;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.repository.WorkspaceRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.RepositoryPolicy;
|
||||
import org.eclipse.aether.repository.WorkspaceReader;
|
||||
import org.eclipse.aether.repository.WorkspaceRepository;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -27,8 +27,8 @@ import org.apache.maven.project.MavenProject;
|
|||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
// TODO: the antrun plugin has its own configurator, the only plugin that does. might need to think about how that works
|
||||
// TODO: remove the coreArtifactFilterManager
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.apache.maven.project.ExtensionDescriptor;
|
|||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
|
||||
/**
|
||||
* Default extension realm cache implementation. Assumes cached data does not change.
|
||||
|
|
|
@ -28,12 +28,12 @@ import java.util.Map;
|
|||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.WorkspaceRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.WorkspaceRepository;
|
||||
|
||||
/**
|
||||
* @author Igor Fedorenko
|
||||
|
|
|
@ -30,10 +30,10 @@ import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
|||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.repository.ComponentDescriptor;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.WorkspaceRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.WorkspaceRepository;
|
||||
|
||||
/**
|
||||
* Caches raw plugin descriptors. A raw plugin descriptor is a descriptor that has just been extracted from the plugin
|
||||
|
|
|
@ -30,11 +30,11 @@ import org.apache.maven.model.Plugin;
|
|||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.WorkspaceRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.WorkspaceRepository;
|
||||
|
||||
/**
|
||||
* Default PluginCache implementation. Assumes cached data does not change.
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.List;
|
|||
import org.apache.maven.project.ExtensionDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
|
||||
/**
|
||||
* Caches extension class realms. <strong>Warning:</strong> This is an internal utility interface that is only public
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.maven.plugin;
|
|||
*/
|
||||
|
||||
import org.apache.maven.execution.MavenSession;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
|
||||
/**
|
||||
* Helps to provide backward-compatibility with plugins that use legacy components. <strong>Warning:</strong> This is an
|
||||
|
|
|
@ -25,9 +25,9 @@ import org.apache.maven.execution.MavenSession;
|
|||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such
|
||||
|
|
|
@ -23,10 +23,10 @@ import java.util.List;
|
|||
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Caches plugin artifacts. <strong>Warning:</strong> This is an internal utility interface that is only public for
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.util.List;
|
|||
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Caches raw plugin descriptors. A raw plugin descriptor is a descriptor that has just been extracted from the plugin
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.apache.maven.artifact.Artifact;
|
|||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Caches plugin class realms. <strong>Warning:</strong> This is an internal utility interface that is only public for
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.plugin.internal;
|
|||
import org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.plugin.LegacySupport;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
|
||||
/**
|
||||
* Helps to provide backward-compatibility with plugins that use legacy components. <strong>Warning:</strong> This is an
|
||||
|
|
|
@ -87,12 +87,12 @@ import org.codehaus.plexus.util.IOUtil;
|
|||
import org.codehaus.plexus.util.ReaderFactory;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.util.filter.AndDependencyFilter;
|
||||
import org.sonatype.aether.util.graph.PreorderNodeListGenerator;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.util.filter.AndDependencyFilter;
|
||||
import org.eclipse.aether.util.graph.PreorderNodeListGenerator;
|
||||
|
||||
/**
|
||||
* Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such
|
||||
|
@ -139,7 +139,7 @@ public class DefaultMavenPluginManager
|
|||
|
||||
if ( pluginDescriptor == null )
|
||||
{
|
||||
org.sonatype.aether.artifact.Artifact artifact =
|
||||
org.eclipse.aether.artifact.Artifact artifact =
|
||||
pluginDependenciesResolver.resolve( plugin, repositories, session );
|
||||
|
||||
Artifact pluginArtifact = RepositoryUtils.toArtifact( artifact );
|
||||
|
@ -369,7 +369,7 @@ public class DefaultMavenPluginManager
|
|||
}
|
||||
}
|
||||
|
||||
List<org.sonatype.aether.artifact.Artifact> pluginArtifacts = nlg.getArtifacts( true );
|
||||
List<org.eclipse.aether.artifact.Artifact> pluginArtifacts = nlg.getArtifacts( true );
|
||||
|
||||
ClassRealm pluginRealm =
|
||||
classRealmManager.createPluginRealm( plugin, parent, null, foreignImports, pluginArtifacts );
|
||||
|
|
|
@ -31,35 +31,34 @@ import org.apache.maven.plugin.PluginResolutionException;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.collection.CollectRequest;
|
||||
import org.sonatype.aether.collection.DependencyCollectionException;
|
||||
import org.sonatype.aether.collection.DependencyGraphTransformer;
|
||||
import org.sonatype.aether.collection.DependencySelector;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.sonatype.aether.graph.DependencyVisitor;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.resolution.ArtifactDescriptorException;
|
||||
import org.sonatype.aether.resolution.ArtifactDescriptorRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactDescriptorResult;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.resolution.DependencyRequest;
|
||||
import org.sonatype.aether.resolution.DependencyResolutionException;
|
||||
import org.sonatype.aether.util.DefaultRepositorySystemSession;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.FilterRepositorySystemSession;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.sonatype.aether.util.artifact.JavaScopes;
|
||||
import org.sonatype.aether.util.filter.AndDependencyFilter;
|
||||
import org.sonatype.aether.util.filter.ExclusionsDependencyFilter;
|
||||
import org.sonatype.aether.util.filter.ScopeDependencyFilter;
|
||||
import org.sonatype.aether.util.graph.selector.AndDependencySelector;
|
||||
import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.collection.CollectRequest;
|
||||
import org.eclipse.aether.collection.DependencyCollectionException;
|
||||
import org.eclipse.aether.collection.DependencyGraphTransformer;
|
||||
import org.eclipse.aether.collection.DependencySelector;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.graph.DependencyVisitor;
|
||||
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.DependencyRequest;
|
||||
import org.eclipse.aether.resolution.DependencyResolutionException;
|
||||
import org.eclipse.aether.util.DefaultRepositorySystemSession;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.util.artifact.JavaScopes;
|
||||
import org.eclipse.aether.util.filter.AndDependencyFilter;
|
||||
import org.eclipse.aether.util.filter.ExclusionsDependencyFilter;
|
||||
import org.eclipse.aether.util.filter.ScopeDependencyFilter;
|
||||
import org.eclipse.aether.util.graph.selector.AndDependencySelector;
|
||||
import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
|
||||
|
||||
/**
|
||||
* Assists in resolving the dependencies of a plugin. <strong>Warning:</strong> This is an internal utility class that
|
||||
|
@ -100,14 +99,8 @@ public class DefaultPluginDependenciesResolver
|
|||
|
||||
try
|
||||
{
|
||||
RepositorySystemSession pluginSession = new FilterRepositorySystemSession( session )
|
||||
{
|
||||
@Override
|
||||
public boolean isIgnoreMissingArtifactDescriptor()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
RepositorySystemSession pluginSession =
|
||||
new DefaultRepositorySystemSession( session ).setIgnoreMissingArtifactDescriptor( true );
|
||||
|
||||
ArtifactDescriptorRequest request =
|
||||
new ArtifactDescriptorRequest( pluginArtifact, repositories, REPOSITORY_CONTEXT );
|
||||
|
@ -179,10 +172,10 @@ public class DefaultPluginDependenciesResolver
|
|||
CollectRequest request = new CollectRequest();
|
||||
request.setRequestContext( REPOSITORY_CONTEXT );
|
||||
request.setRepositories( repositories );
|
||||
request.setRoot( new org.sonatype.aether.graph.Dependency( pluginArtifact, null ) );
|
||||
request.setRoot( new org.eclipse.aether.graph.Dependency( pluginArtifact, null ) );
|
||||
for ( Dependency dependency : plugin.getDependencies() )
|
||||
{
|
||||
org.sonatype.aether.graph.Dependency pluginDep =
|
||||
org.eclipse.aether.graph.Dependency pluginDep =
|
||||
RepositoryUtils.toDependency( dependency, session.getArtifactTypeRegistry() );
|
||||
if ( !JavaScopes.SYSTEM.equals( pluginDep.getScope() ) )
|
||||
{
|
||||
|
@ -228,10 +221,10 @@ public class DefaultPluginDependenciesResolver
|
|||
{
|
||||
StringBuilder buffer = new StringBuilder( 128 );
|
||||
buffer.append( indent );
|
||||
org.sonatype.aether.graph.Dependency dep = node.getDependency();
|
||||
org.eclipse.aether.graph.Dependency dep = node.getDependency();
|
||||
if ( dep != null )
|
||||
{
|
||||
org.sonatype.aether.artifact.Artifact art = dep.getArtifact();
|
||||
org.eclipse.aether.artifact.Artifact art = dep.getArtifact();
|
||||
|
||||
buffer.append( art );
|
||||
buffer.append( ':' ).append( dep.getScope() );
|
||||
|
|
|
@ -19,15 +19,15 @@ package org.apache.maven.plugin.internal;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.sonatype.aether.RepositoryException;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.collection.DependencyGraphTransformationContext;
|
||||
import org.sonatype.aether.collection.DependencyGraphTransformer;
|
||||
import org.sonatype.aether.graph.Dependency;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.sonatype.aether.util.artifact.JavaScopes;
|
||||
import org.sonatype.aether.util.graph.DefaultDependencyNode;
|
||||
import org.eclipse.aether.RepositoryException;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.collection.DependencyGraphTransformationContext;
|
||||
import org.eclipse.aether.collection.DependencyGraphTransformer;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.util.artifact.JavaScopes;
|
||||
import org.eclipse.aether.util.graph.DefaultDependencyNode;
|
||||
|
||||
/**
|
||||
* Injects plexus-utils:1.1 into a plugin's class path if it doesn't already declare a dependency on plexus-utils. This
|
||||
|
|
|
@ -23,11 +23,11 @@ import java.util.List;
|
|||
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.plugin.PluginResolutionException;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Assists in resolving the dependencies of a plugin. <strong>Warning:</strong> This is an internal utility interface
|
||||
|
|
|
@ -19,10 +19,10 @@ package org.apache.maven.plugin.internal;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.collection.DependencyCollectionContext;
|
||||
import org.sonatype.aether.collection.DependencySelector;
|
||||
import org.sonatype.aether.graph.Dependency;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.collection.DependencyCollectionContext;
|
||||
import org.eclipse.aether.collection.DependencySelector;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
|
||||
/**
|
||||
* Assists in detecting wagon providers brought into the plugin class path via legacy Maven core artifacts (e.g.
|
||||
|
|
|
@ -25,8 +25,8 @@ import java.util.List;
|
|||
import org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Collects settings required to resolve a plugin prefix.
|
||||
|
|
|
@ -21,8 +21,8 @@ package org.apache.maven.plugin.prefix;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
public class NoPluginFoundForPrefixException
|
||||
extends Exception
|
||||
|
|
|
@ -22,8 +22,8 @@ package org.apache.maven.plugin.prefix;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.maven.model.Model;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Collects settings required to resolve a plugin prefix.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.apache.maven.plugin.prefix;
|
||||
|
||||
import org.sonatype.aether.repository.ArtifactRepository;
|
||||
import org.eclipse.aether.repository.ArtifactRepository;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
|
@ -38,20 +38,20 @@ import org.apache.maven.plugin.prefix.PluginPrefixResult;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.repository.ArtifactRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.RepositoryPolicy;
|
||||
import org.sonatype.aether.resolution.MetadataRequest;
|
||||
import org.sonatype.aether.resolution.MetadataResult;
|
||||
import org.sonatype.aether.util.DefaultRepositorySystemSession;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.sonatype.aether.util.metadata.DefaultMetadata;
|
||||
import org.eclipse.aether.RepositoryEvent.EventType;
|
||||
import org.eclipse.aether.RepositoryListener;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.repository.ArtifactRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.RepositoryPolicy;
|
||||
import org.eclipse.aether.resolution.MetadataRequest;
|
||||
import org.eclipse.aether.resolution.MetadataResult;
|
||||
import org.eclipse.aether.util.DefaultRepositorySystemSession;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.eclipse.aether.util.metadata.DefaultMetadata;
|
||||
|
||||
/**
|
||||
* Resolves a plugin prefix.
|
||||
|
@ -169,7 +169,7 @@ public class DefaultPluginPrefixResolver
|
|||
|
||||
for ( String pluginGroup : request.getPluginGroups() )
|
||||
{
|
||||
org.sonatype.aether.metadata.Metadata metadata =
|
||||
org.eclipse.aether.metadata.Metadata metadata =
|
||||
new DefaultMetadata( pluginGroup, "maven-metadata.xml", DefaultMetadata.Nature.RELEASE_OR_SNAPSHOT );
|
||||
|
||||
requests.add( new MetadataRequest( metadata, null, REPOSITORY_CONTEXT ).setTrace( trace ) );
|
||||
|
@ -213,7 +213,7 @@ public class DefaultPluginPrefixResolver
|
|||
{
|
||||
for ( MetadataResult res : results )
|
||||
{
|
||||
org.sonatype.aether.metadata.Metadata metadata = res.getMetadata();
|
||||
org.eclipse.aether.metadata.Metadata metadata = res.getMetadata();
|
||||
|
||||
if ( metadata != null )
|
||||
{
|
||||
|
@ -243,7 +243,7 @@ public class DefaultPluginPrefixResolver
|
|||
|
||||
private PluginPrefixResult resolveFromRepository( PluginPrefixRequest request, RequestTrace trace,
|
||||
String pluginGroup,
|
||||
org.sonatype.aether.metadata.Metadata metadata,
|
||||
org.eclipse.aether.metadata.Metadata metadata,
|
||||
ArtifactRepository repository )
|
||||
{
|
||||
if ( metadata != null && metadata.getFile() != null && metadata.getFile().isFile() )
|
||||
|
@ -277,7 +277,7 @@ public class DefaultPluginPrefixResolver
|
|||
}
|
||||
|
||||
private void invalidMetadata( RepositorySystemSession session, RequestTrace trace,
|
||||
org.sonatype.aether.metadata.Metadata metadata, ArtifactRepository repository,
|
||||
org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository,
|
||||
Exception exception )
|
||||
{
|
||||
RepositoryListener listener = session.getRepositoryListener();
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.maven.plugin.prefix.internal;
|
|||
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.plugin.prefix.PluginPrefixResult;
|
||||
import org.sonatype.aether.repository.ArtifactRepository;
|
||||
import org.eclipse.aether.repository.ArtifactRepository;
|
||||
|
||||
/**
|
||||
* Describes the result of a plugin prefix resolution request.
|
||||
|
|
|
@ -26,8 +26,8 @@ import org.apache.maven.execution.MavenSession;
|
|||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Collects settings required to resolve the version for a plugin.
|
||||
|
|
|
@ -22,8 +22,8 @@ package org.apache.maven.plugin.version;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.maven.model.Model;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* Collects settings required to resolve the version for a plugin.
|
||||
|
|
|
@ -21,8 +21,8 @@ package org.apache.maven.plugin.version;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.sonatype.aether.repository.LocalRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.LocalRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
public class PluginVersionResolutionException
|
||||
extends Exception
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.maven.plugin.version;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.sonatype.aether.repository.ArtifactRepository;
|
||||
import org.eclipse.aether.repository.ArtifactRepository;
|
||||
|
||||
/**
|
||||
* Describes the result of a plugin version resolution request.
|
||||
|
|
|
@ -43,22 +43,22 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.sonatype.aether.RepositoryEvent.EventType;
|
||||
import org.sonatype.aether.RepositoryListener;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.repository.ArtifactRepository;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.resolution.MetadataRequest;
|
||||
import org.sonatype.aether.resolution.MetadataResult;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.sonatype.aether.util.metadata.DefaultMetadata;
|
||||
import org.sonatype.aether.util.version.GenericVersionScheme;
|
||||
import org.sonatype.aether.version.InvalidVersionSpecificationException;
|
||||
import org.sonatype.aether.version.Version;
|
||||
import org.sonatype.aether.version.VersionScheme;
|
||||
import org.eclipse.aether.RepositoryEvent.EventType;
|
||||
import org.eclipse.aether.RepositoryListener;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.repository.ArtifactRepository;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.resolution.MetadataRequest;
|
||||
import org.eclipse.aether.resolution.MetadataResult;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
|
||||
import org.eclipse.aether.util.metadata.DefaultMetadata;
|
||||
import org.eclipse.aether.util.version.GenericVersionScheme;
|
||||
import org.eclipse.aether.version.InvalidVersionSpecificationException;
|
||||
import org.eclipse.aether.version.Version;
|
||||
import org.eclipse.aether.version.VersionScheme;
|
||||
|
||||
/**
|
||||
* Resolves a version for a plugin.
|
||||
|
@ -118,7 +118,7 @@ public class DefaultPluginVersionResolver
|
|||
|
||||
DefaultPluginVersionResult result = new DefaultPluginVersionResult();
|
||||
|
||||
org.sonatype.aether.metadata.Metadata metadata =
|
||||
org.eclipse.aether.metadata.Metadata metadata =
|
||||
new DefaultMetadata( request.getGroupId(), request.getArtifactId(), "maven-metadata.xml",
|
||||
DefaultMetadata.Nature.RELEASE_OR_SNAPSHOT );
|
||||
|
||||
|
@ -280,7 +280,7 @@ public class DefaultPluginVersionResolver
|
|||
}
|
||||
|
||||
private void mergeMetadata( RepositorySystemSession session, RequestTrace trace, Versions versions,
|
||||
org.sonatype.aether.metadata.Metadata metadata, ArtifactRepository repository )
|
||||
org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository )
|
||||
{
|
||||
if ( metadata != null && metadata.getFile() != null && metadata.getFile().isFile() )
|
||||
{
|
||||
|
@ -300,7 +300,7 @@ public class DefaultPluginVersionResolver
|
|||
}
|
||||
|
||||
private void invalidMetadata( RepositorySystemSession session, RequestTrace trace,
|
||||
org.sonatype.aether.metadata.Metadata metadata, ArtifactRepository repository,
|
||||
org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository,
|
||||
Exception exception )
|
||||
{
|
||||
RepositoryListener listener = session.getRepositoryListener();
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.maven.plugin.version.internal;
|
|||
*/
|
||||
|
||||
import org.apache.maven.plugin.version.PluginVersionResult;
|
||||
import org.sonatype.aether.repository.ArtifactRepository;
|
||||
import org.eclipse.aether.repository.ArtifactRepository;
|
||||
|
||||
/**
|
||||
* Describes the result of a plugin version resolution request.
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.maven.project;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -25,8 +25,8 @@ import java.util.IdentityHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.sonatype.aether.graph.Dependency;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
|
|
@ -51,15 +51,15 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.Os;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.impl.RemoteRepositoryManager;
|
||||
import org.sonatype.aether.repository.LocalRepositoryManager;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.repository.WorkspaceRepository;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResult;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.impl.RemoteRepositoryManager;
|
||||
import org.eclipse.aether.repository.LocalRepositoryManager;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.repository.WorkspaceRepository;
|
||||
import org.eclipse.aether.resolution.ArtifactRequest;
|
||||
import org.eclipse.aether.resolution.ArtifactResult;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
@ -84,7 +84,7 @@ public class DefaultProjectBuilder
|
|||
private RepositorySystem repositorySystem;
|
||||
|
||||
@Requirement
|
||||
private org.sonatype.aether.RepositorySystem repoSystem;
|
||||
private org.eclipse.aether.RepositorySystem repoSystem;
|
||||
|
||||
@Requirement
|
||||
private RemoteRepositoryManager repositoryManager;
|
||||
|
@ -270,7 +270,7 @@ public class DefaultProjectBuilder
|
|||
public ProjectBuildingResult build( Artifact artifact, boolean allowStubModel, ProjectBuildingRequest request )
|
||||
throws ProjectBuildingException
|
||||
{
|
||||
org.sonatype.aether.artifact.Artifact pomArtifact = RepositoryUtils.toArtifact( artifact );
|
||||
org.eclipse.aether.artifact.Artifact pomArtifact = RepositoryUtils.toArtifact( artifact );
|
||||
pomArtifact = ArtifactDescriptorUtils.toPomArtifact( pomArtifact );
|
||||
|
||||
InternalConfig config = new InternalConfig( request, null, null );
|
||||
|
@ -287,7 +287,7 @@ public class DefaultProjectBuilder
|
|||
pomArtifact = pomResult.getArtifact();
|
||||
localProject = pomResult.getRepository() instanceof WorkspaceRepository;
|
||||
}
|
||||
catch ( org.sonatype.aether.resolution.ArtifactResolutionException e )
|
||||
catch ( org.eclipse.aether.resolution.ArtifactResolutionException e )
|
||||
{
|
||||
if ( e.getResults().get( 0 ).isMissing() && allowStubModel )
|
||||
{
|
||||
|
|
|
@ -52,12 +52,12 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.util.filter.ExclusionsDependencyFilter;
|
||||
import org.sonatype.aether.util.graph.PreorderNodeListGenerator;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.util.filter.ExclusionsDependencyFilter;
|
||||
import org.eclipse.aether.util.graph.PreorderNodeListGenerator;
|
||||
|
||||
/**
|
||||
* Assists the project builder. <strong>Warning:</strong> This is an internal utility class that is only public for
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.Properties;
|
|||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.model.building.ModelBuildingRequest;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
|
||||
public class DefaultProjectBuildingRequest
|
||||
implements ProjectBuildingRequest
|
||||
|
|
|
@ -34,22 +34,22 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.artifact.ArtifactType;
|
||||
import org.sonatype.aether.artifact.ArtifactTypeRegistry;
|
||||
import org.sonatype.aether.collection.CollectRequest;
|
||||
import org.sonatype.aether.collection.DependencyCollectionException;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.sonatype.aether.graph.DependencyVisitor;
|
||||
import org.sonatype.aether.resolution.ArtifactResult;
|
||||
import org.sonatype.aether.resolution.DependencyRequest;
|
||||
import org.sonatype.aether.util.DefaultRequestTrace;
|
||||
import org.sonatype.aether.util.artifact.ArtifacIdUtils;
|
||||
import org.sonatype.aether.util.artifact.ArtifactProperties;
|
||||
import org.sonatype.aether.util.artifact.JavaScopes;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.artifact.ArtifactProperties;
|
||||
import org.eclipse.aether.artifact.ArtifactType;
|
||||
import org.eclipse.aether.artifact.ArtifactTypeRegistry;
|
||||
import org.eclipse.aether.collection.CollectRequest;
|
||||
import org.eclipse.aether.collection.DependencyCollectionException;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.graph.DependencyVisitor;
|
||||
import org.eclipse.aether.resolution.ArtifactResult;
|
||||
import org.eclipse.aether.resolution.DependencyRequest;
|
||||
import org.eclipse.aether.util.DefaultRequestTrace;
|
||||
import org.eclipse.aether.util.artifact.ArtifactIdUtils;
|
||||
import org.eclipse.aether.util.artifact.JavaScopes;
|
||||
|
||||
/**
|
||||
* @author Benjamin Bentmann
|
||||
|
@ -110,7 +110,7 @@ public class DefaultProjectDependenciesResolver
|
|||
}
|
||||
}
|
||||
String key =
|
||||
ArtifacIdUtils.toVersionlessId( dependency.getGroupId(), dependency.getArtifactId(),
|
||||
ArtifactIdUtils.toVersionlessId( dependency.getGroupId(), dependency.getArtifactId(),
|
||||
dependency.getType(), classifier );
|
||||
dependencies.put( key, dependency );
|
||||
}
|
||||
|
@ -119,11 +119,11 @@ public class DefaultProjectDependenciesResolver
|
|||
String key = artifact.getDependencyConflictId();
|
||||
Dependency dependency = dependencies.get( key );
|
||||
Collection<Exclusion> exclusions = dependency != null ? dependency.getExclusions() : null;
|
||||
org.sonatype.aether.graph.Dependency dep = RepositoryUtils.toDependency( artifact, exclusions );
|
||||
org.eclipse.aether.graph.Dependency dep = RepositoryUtils.toDependency( artifact, exclusions );
|
||||
if ( !JavaScopes.SYSTEM.equals( dep.getScope() ) && dep.getArtifact().getFile() != null )
|
||||
{
|
||||
// enable re-resolution
|
||||
org.sonatype.aether.artifact.Artifact art = dep.getArtifact();
|
||||
org.eclipse.aether.artifact.Artifact art = dep.getArtifact();
|
||||
art = art.setFile( null ).setVersion( art.getBaseVersion() );
|
||||
dep = dep.setArtifact( art );
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ public class DefaultProjectDependenciesResolver
|
|||
{
|
||||
process( result, repoSystem.resolveDependencies( session, depRequest ).getArtifactResults() );
|
||||
}
|
||||
catch ( org.sonatype.aether.resolution.DependencyResolutionException e )
|
||||
catch ( org.eclipse.aether.resolution.DependencyResolutionException e )
|
||||
{
|
||||
process( result, e.getResult().getArtifactResults() );
|
||||
|
||||
|
@ -228,10 +228,10 @@ public class DefaultProjectDependenciesResolver
|
|||
{
|
||||
StringBuilder buffer = new StringBuilder( 128 );
|
||||
buffer.append( indent );
|
||||
org.sonatype.aether.graph.Dependency dep = node.getDependency();
|
||||
org.eclipse.aether.graph.Dependency dep = node.getDependency();
|
||||
if ( dep != null )
|
||||
{
|
||||
org.sonatype.aether.artifact.Artifact art = dep.getArtifact();
|
||||
org.eclipse.aether.artifact.Artifact art = dep.getArtifact();
|
||||
|
||||
buffer.append( art );
|
||||
buffer.append( ':' ).append( dep.getScope() );
|
||||
|
@ -269,7 +269,7 @@ public class DefaultProjectDependenciesResolver
|
|||
return true;
|
||||
}
|
||||
|
||||
private void appendManagementSource( StringBuilder buffer, org.sonatype.aether.artifact.Artifact artifact,
|
||||
private void appendManagementSource( StringBuilder buffer, org.eclipse.aether.artifact.Artifact artifact,
|
||||
String field )
|
||||
{
|
||||
if ( managed == null )
|
||||
|
@ -285,7 +285,7 @@ public class DefaultProjectDependenciesResolver
|
|||
}
|
||||
|
||||
String key =
|
||||
ArtifacIdUtils.toVersionlessId( artifact.getGroupId(), artifact.getArtifactId(),
|
||||
ArtifactIdUtils.toVersionlessId( artifact.getGroupId(), artifact.getArtifactId(),
|
||||
artifact.getProperty( ArtifactProperties.TYPE, "jar" ),
|
||||
artifact.getClassifier() );
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Map;
|
|||
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
|
||||
/**
|
||||
* Default project realm cache implementation. Assumes cached data does not change.
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.maven.project;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
|
||||
/**
|
||||
* A request to resolve the dependencies of a project.
|
||||
|
|
|
@ -21,8 +21,8 @@ package org.apache.maven.project;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.sonatype.aether.graph.Dependency;
|
||||
import org.sonatype.aether.graph.DependencyNode;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.graph.DependencyNode;
|
||||
|
||||
/**
|
||||
* The result of a project dependency resolution.
|
||||
|
|
|
@ -72,8 +72,8 @@ import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
|||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
|
||||
/**
|
||||
* The concern of the project is provide runtime values based on the model.
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Properties;
|
|||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.model.building.ModelBuildingRequest;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
|
||||
public interface ProjectBuildingRequest
|
||||
{
|
||||
|
|
|
@ -33,15 +33,15 @@ import org.apache.maven.model.resolution.InvalidRepositoryException;
|
|||
import org.apache.maven.model.resolution.ModelResolver;
|
||||
import org.apache.maven.model.resolution.UnresolvableModelException;
|
||||
import org.apache.maven.repository.internal.ArtifactDescriptorUtils;
|
||||
import org.sonatype.aether.RepositorySystem;
|
||||
import org.sonatype.aether.RepositorySystemSession;
|
||||
import org.sonatype.aether.RequestTrace;
|
||||
import org.sonatype.aether.artifact.Artifact;
|
||||
import org.sonatype.aether.impl.RemoteRepositoryManager;
|
||||
import org.sonatype.aether.repository.RemoteRepository;
|
||||
import org.sonatype.aether.resolution.ArtifactRequest;
|
||||
import org.sonatype.aether.resolution.ArtifactResolutionException;
|
||||
import org.sonatype.aether.util.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.RequestTrace;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.impl.RemoteRepositoryManager;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.eclipse.aether.resolution.ArtifactRequest;
|
||||
import org.eclipse.aether.resolution.ArtifactResolutionException;
|
||||
import org.eclipse.aether.util.artifact.DefaultArtifact;
|
||||
|
||||
/**
|
||||
* A model resolver to assist building of projects. This resolver gives priority to those repositories that have been
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.project;
|
|||
import java.util.List;
|
||||
|
||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||
import org.sonatype.aether.graph.DependencyFilter;
|
||||
import org.eclipse.aether.graph.DependencyFilter;
|
||||
|
||||
/**
|
||||
* Caches project class realms. <strong>Warning:</strong> This is an internal utility interface that is only public for
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue