mirror of https://github.com/apache/maven.git
parent
13a0a5f51f
commit
6e619a1bcb
|
@ -108,6 +108,15 @@ under the License.
|
||||||
<artifactId>mockito-core</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -67,9 +67,6 @@ import org.eclipse.aether.resolution.VersionResolutionException;
|
||||||
import org.eclipse.aether.resolution.VersionResult;
|
import org.eclipse.aether.resolution.VersionResult;
|
||||||
import org.eclipse.aether.spi.locator.Service;
|
import org.eclipse.aether.spi.locator.Service;
|
||||||
import org.eclipse.aether.spi.locator.ServiceLocator;
|
import org.eclipse.aether.spi.locator.ServiceLocator;
|
||||||
import org.eclipse.aether.spi.log.Logger;
|
|
||||||
import org.eclipse.aether.spi.log.LoggerFactory;
|
|
||||||
import org.eclipse.aether.spi.log.NullLoggerFactory;
|
|
||||||
import org.eclipse.aether.transfer.ArtifactNotFoundException;
|
import org.eclipse.aether.transfer.ArtifactNotFoundException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,10 +77,6 @@ import org.eclipse.aether.transfer.ArtifactNotFoundException;
|
||||||
public class DefaultArtifactDescriptorReader
|
public class DefaultArtifactDescriptorReader
|
||||||
implements ArtifactDescriptorReader, Service
|
implements ArtifactDescriptorReader, Service
|
||||||
{
|
{
|
||||||
|
|
||||||
@SuppressWarnings( "unused" )
|
|
||||||
private Logger logger = NullLoggerFactory.LOGGER;
|
|
||||||
|
|
||||||
private RemoteRepositoryManager remoteRepositoryManager;
|
private RemoteRepositoryManager remoteRepositoryManager;
|
||||||
|
|
||||||
private VersionResolver versionResolver;
|
private VersionResolver versionResolver;
|
||||||
|
@ -104,15 +97,13 @@ public class DefaultArtifactDescriptorReader
|
||||||
@Inject
|
@Inject
|
||||||
DefaultArtifactDescriptorReader( RemoteRepositoryManager remoteRepositoryManager, VersionResolver versionResolver,
|
DefaultArtifactDescriptorReader( RemoteRepositoryManager remoteRepositoryManager, VersionResolver versionResolver,
|
||||||
VersionRangeResolver versionRangeResolver, ArtifactResolver artifactResolver,
|
VersionRangeResolver versionRangeResolver, ArtifactResolver artifactResolver,
|
||||||
ModelBuilder modelBuilder, RepositoryEventDispatcher repositoryEventDispatcher,
|
ModelBuilder modelBuilder, RepositoryEventDispatcher repositoryEventDispatcher )
|
||||||
LoggerFactory loggerFactory )
|
|
||||||
{
|
{
|
||||||
setRemoteRepositoryManager( remoteRepositoryManager );
|
setRemoteRepositoryManager( remoteRepositoryManager );
|
||||||
setVersionResolver( versionResolver );
|
setVersionResolver( versionResolver );
|
||||||
setVersionRangeResolver( versionRangeResolver );
|
setVersionRangeResolver( versionRangeResolver );
|
||||||
setArtifactResolver( artifactResolver );
|
setArtifactResolver( artifactResolver );
|
||||||
setModelBuilder( modelBuilder );
|
setModelBuilder( modelBuilder );
|
||||||
setLoggerFactory( loggerFactory );
|
|
||||||
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,19 +119,6 @@ public class DefaultArtifactDescriptorReader
|
||||||
setModelBuilder( new DefaultModelBuilderFactory().newInstance() );
|
setModelBuilder( new DefaultModelBuilderFactory().newInstance() );
|
||||||
}
|
}
|
||||||
setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
|
setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
|
||||||
setLoggerFactory( locator.getService( LoggerFactory.class ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultArtifactDescriptorReader setLoggerFactory( LoggerFactory loggerFactory )
|
|
||||||
{
|
|
||||||
this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setLogger( LoggerFactory loggerFactory )
|
|
||||||
{
|
|
||||||
// plexus support
|
|
||||||
setLoggerFactory( loggerFactory );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultArtifactDescriptorReader setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager )
|
public DefaultArtifactDescriptorReader setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager )
|
||||||
|
|
|
@ -42,9 +42,6 @@ import org.eclipse.aether.resolution.VersionRangeResolutionException;
|
||||||
import org.eclipse.aether.resolution.VersionRangeResult;
|
import org.eclipse.aether.resolution.VersionRangeResult;
|
||||||
import org.eclipse.aether.spi.locator.Service;
|
import org.eclipse.aether.spi.locator.Service;
|
||||||
import org.eclipse.aether.spi.locator.ServiceLocator;
|
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.version.GenericVersionScheme;
|
import org.eclipse.aether.util.version.GenericVersionScheme;
|
||||||
import org.eclipse.aether.version.InvalidVersionSpecificationException;
|
import org.eclipse.aether.version.InvalidVersionSpecificationException;
|
||||||
import org.eclipse.aether.version.Version;
|
import org.eclipse.aether.version.Version;
|
||||||
|
@ -75,9 +72,6 @@ public class DefaultVersionRangeResolver
|
||||||
|
|
||||||
private static final String MAVEN_METADATA_XML = "maven-metadata.xml";
|
private static final String MAVEN_METADATA_XML = "maven-metadata.xml";
|
||||||
|
|
||||||
@SuppressWarnings( "unused" )
|
|
||||||
private Logger logger = NullLoggerFactory.LOGGER;
|
|
||||||
|
|
||||||
private MetadataResolver metadataResolver;
|
private MetadataResolver metadataResolver;
|
||||||
|
|
||||||
private SyncContextFactory syncContextFactory;
|
private SyncContextFactory syncContextFactory;
|
||||||
|
@ -91,34 +85,20 @@ public class DefaultVersionRangeResolver
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
DefaultVersionRangeResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory,
|
DefaultVersionRangeResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory,
|
||||||
RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory )
|
RepositoryEventDispatcher repositoryEventDispatcher )
|
||||||
{
|
{
|
||||||
setMetadataResolver( metadataResolver );
|
setMetadataResolver( metadataResolver );
|
||||||
setSyncContextFactory( syncContextFactory );
|
setSyncContextFactory( syncContextFactory );
|
||||||
setLoggerFactory( loggerFactory );
|
|
||||||
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initService( ServiceLocator locator )
|
public void initService( ServiceLocator locator )
|
||||||
{
|
{
|
||||||
setLoggerFactory( locator.getService( LoggerFactory.class ) );
|
|
||||||
setMetadataResolver( locator.getService( MetadataResolver.class ) );
|
setMetadataResolver( locator.getService( MetadataResolver.class ) );
|
||||||
setSyncContextFactory( locator.getService( SyncContextFactory.class ) );
|
setSyncContextFactory( locator.getService( SyncContextFactory.class ) );
|
||||||
setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
|
setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultVersionRangeResolver setLoggerFactory( LoggerFactory loggerFactory )
|
|
||||||
{
|
|
||||||
this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setLogger( LoggerFactory loggerFactory )
|
|
||||||
{
|
|
||||||
// plexus support
|
|
||||||
setLoggerFactory( loggerFactory );
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultVersionRangeResolver setMetadataResolver( MetadataResolver metadataResolver )
|
public DefaultVersionRangeResolver setMetadataResolver( MetadataResolver metadataResolver )
|
||||||
{
|
{
|
||||||
this.metadataResolver = Objects.requireNonNull( metadataResolver, "metadataResolver cannot be null" );
|
this.metadataResolver = Objects.requireNonNull( metadataResolver, "metadataResolver cannot be null" );
|
||||||
|
|
|
@ -50,9 +50,6 @@ import org.eclipse.aether.resolution.VersionResolutionException;
|
||||||
import org.eclipse.aether.resolution.VersionResult;
|
import org.eclipse.aether.resolution.VersionResult;
|
||||||
import org.eclipse.aether.spi.locator.Service;
|
import org.eclipse.aether.spi.locator.Service;
|
||||||
import org.eclipse.aether.spi.locator.ServiceLocator;
|
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.ConfigUtils;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
@ -87,9 +84,6 @@ public class DefaultVersionResolver
|
||||||
|
|
||||||
private static final String SNAPSHOT = "SNAPSHOT";
|
private static final String SNAPSHOT = "SNAPSHOT";
|
||||||
|
|
||||||
@SuppressWarnings( "unused" )
|
|
||||||
private Logger logger = NullLoggerFactory.LOGGER;
|
|
||||||
|
|
||||||
private MetadataResolver metadataResolver;
|
private MetadataResolver metadataResolver;
|
||||||
|
|
||||||
private SyncContextFactory syncContextFactory;
|
private SyncContextFactory syncContextFactory;
|
||||||
|
@ -103,34 +97,20 @@ public class DefaultVersionResolver
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
DefaultVersionResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory,
|
DefaultVersionResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory,
|
||||||
RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory )
|
RepositoryEventDispatcher repositoryEventDispatcher )
|
||||||
{
|
{
|
||||||
setMetadataResolver( metadataResolver );
|
setMetadataResolver( metadataResolver );
|
||||||
setSyncContextFactory( syncContextFactory );
|
setSyncContextFactory( syncContextFactory );
|
||||||
setLoggerFactory( loggerFactory );
|
|
||||||
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
setRepositoryEventDispatcher( repositoryEventDispatcher );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initService( ServiceLocator locator )
|
public void initService( ServiceLocator locator )
|
||||||
{
|
{
|
||||||
setLoggerFactory( locator.getService( LoggerFactory.class ) );
|
|
||||||
setMetadataResolver( locator.getService( MetadataResolver.class ) );
|
setMetadataResolver( locator.getService( MetadataResolver.class ) );
|
||||||
setSyncContextFactory( locator.getService( SyncContextFactory.class ) );
|
setSyncContextFactory( locator.getService( SyncContextFactory.class ) );
|
||||||
setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
|
setRepositoryEventDispatcher( locator.getService( RepositoryEventDispatcher.class ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultVersionResolver setLoggerFactory( LoggerFactory loggerFactory )
|
|
||||||
{
|
|
||||||
this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() );
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setLogger( LoggerFactory loggerFactory )
|
|
||||||
{
|
|
||||||
// plexus support
|
|
||||||
setLoggerFactory( loggerFactory );
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultVersionResolver setMetadataResolver( MetadataResolver metadataResolver )
|
public DefaultVersionResolver setMetadataResolver( MetadataResolver metadataResolver )
|
||||||
{
|
{
|
||||||
this.metadataResolver = Objects.requireNonNull( metadataResolver, "metadataResolver cannot be null" );
|
this.metadataResolver = Objects.requireNonNull( metadataResolver, "metadataResolver cannot be null" );
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -64,7 +64,7 @@ under the License.
|
||||||
<cipherVersion>1.7</cipherVersion>
|
<cipherVersion>1.7</cipherVersion>
|
||||||
<modelloVersion>1.9.1</modelloVersion>
|
<modelloVersion>1.9.1</modelloVersion>
|
||||||
<jxpathVersion>1.3</jxpathVersion>
|
<jxpathVersion>1.3</jxpathVersion>
|
||||||
<resolverVersion>1.3.0</resolverVersion>
|
<resolverVersion>1.3.1</resolverVersion>
|
||||||
<slf4jVersion>1.7.25</slf4jVersion>
|
<slf4jVersion>1.7.25</slf4jVersion>
|
||||||
<xmlunitVersion>2.2.1</xmlunitVersion>
|
<xmlunitVersion>2.2.1</xmlunitVersion>
|
||||||
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
|
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
|
||||||
|
|
Loading…
Reference in New Issue