[MNG-6496] Upgrade Maven Resolver to 1.3.1

Fixes #187
This commit is contained in:
Sylwester Lachiewicz 2018-07-09 22:23:06 +02:00 committed by Sylwester Lachiewicz
parent 13a0a5f51f
commit 6e619a1bcb
5 changed files with 13 additions and 66 deletions

View File

@ -108,6 +108,15 @@ under the License.
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</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>
<build>

View File

@ -67,9 +67,6 @@ 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;
/**
@ -80,10 +77,6 @@ import org.eclipse.aether.transfer.ArtifactNotFoundException;
public class DefaultArtifactDescriptorReader
implements ArtifactDescriptorReader, Service
{
@SuppressWarnings( "unused" )
private Logger logger = NullLoggerFactory.LOGGER;
private RemoteRepositoryManager remoteRepositoryManager;
private VersionResolver versionResolver;
@ -104,15 +97,13 @@ public class DefaultArtifactDescriptorReader
@Inject
DefaultArtifactDescriptorReader( RemoteRepositoryManager remoteRepositoryManager, VersionResolver versionResolver,
VersionRangeResolver versionRangeResolver, ArtifactResolver artifactResolver,
ModelBuilder modelBuilder, RepositoryEventDispatcher repositoryEventDispatcher,
LoggerFactory loggerFactory )
ModelBuilder modelBuilder, RepositoryEventDispatcher repositoryEventDispatcher )
{
setRemoteRepositoryManager( remoteRepositoryManager );
setVersionResolver( versionResolver );
setVersionRangeResolver( versionRangeResolver );
setArtifactResolver( artifactResolver );
setModelBuilder( modelBuilder );
setLoggerFactory( loggerFactory );
setRepositoryEventDispatcher( repositoryEventDispatcher );
}
@ -128,19 +119,6 @@ public class DefaultArtifactDescriptorReader
setModelBuilder( new DefaultModelBuilderFactory().newInstance() );
}
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 )

View File

@ -42,9 +42,6 @@ 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.version.GenericVersionScheme;
import org.eclipse.aether.version.InvalidVersionSpecificationException;
import org.eclipse.aether.version.Version;
@ -75,9 +72,6 @@ public class DefaultVersionRangeResolver
private static final String MAVEN_METADATA_XML = "maven-metadata.xml";
@SuppressWarnings( "unused" )
private Logger logger = NullLoggerFactory.LOGGER;
private MetadataResolver metadataResolver;
private SyncContextFactory syncContextFactory;
@ -91,34 +85,20 @@ public class DefaultVersionRangeResolver
@Inject
DefaultVersionRangeResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory,
RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory )
RepositoryEventDispatcher repositoryEventDispatcher )
{
setMetadataResolver( metadataResolver );
setSyncContextFactory( syncContextFactory );
setLoggerFactory( loggerFactory );
setRepositoryEventDispatcher( repositoryEventDispatcher );
}
public void initService( ServiceLocator locator )
{
setLoggerFactory( locator.getService( LoggerFactory.class ) );
setMetadataResolver( locator.getService( MetadataResolver.class ) );
setSyncContextFactory( locator.getService( SyncContextFactory.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 )
{
this.metadataResolver = Objects.requireNonNull( metadataResolver, "metadataResolver cannot be null" );

View File

@ -50,9 +50,6 @@ 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 javax.inject.Inject;
@ -87,9 +84,6 @@ public class DefaultVersionResolver
private static final String SNAPSHOT = "SNAPSHOT";
@SuppressWarnings( "unused" )
private Logger logger = NullLoggerFactory.LOGGER;
private MetadataResolver metadataResolver;
private SyncContextFactory syncContextFactory;
@ -103,34 +97,20 @@ public class DefaultVersionResolver
@Inject
DefaultVersionResolver( MetadataResolver metadataResolver, SyncContextFactory syncContextFactory,
RepositoryEventDispatcher repositoryEventDispatcher, LoggerFactory loggerFactory )
RepositoryEventDispatcher repositoryEventDispatcher )
{
setMetadataResolver( metadataResolver );
setSyncContextFactory( syncContextFactory );
setLoggerFactory( loggerFactory );
setRepositoryEventDispatcher( repositoryEventDispatcher );
}
public void initService( ServiceLocator locator )
{
setLoggerFactory( locator.getService( LoggerFactory.class ) );
setMetadataResolver( locator.getService( MetadataResolver.class ) );
setSyncContextFactory( locator.getService( SyncContextFactory.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 )
{
this.metadataResolver = Objects.requireNonNull( metadataResolver, "metadataResolver cannot be null" );

View File

@ -64,7 +64,7 @@ under the License.
<cipherVersion>1.7</cipherVersion>
<modelloVersion>1.9.1</modelloVersion>
<jxpathVersion>1.3</jxpathVersion>
<resolverVersion>1.3.0</resolverVersion>
<resolverVersion>1.3.1</resolverVersion>
<slf4jVersion>1.7.25</slf4jVersion>
<xmlunitVersion>2.2.1</xmlunitVersion>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>