Search in sources :

Example 1 with Deployer

use of org.sonatype.aether.impl.Deployer in project gradle by gradle.

the class AbstractMavenPublishAction method newRepositorySystem.

private RepositorySystem newRepositorySystem() {
    try {
        DefaultDeployer deployer = (DefaultDeployer) getContainer().lookup(Deployer.class);
        // This is a workaround for https://issues.gradle.org/browse/GRADLE-3324.
        // Somehow the ArrayList 'result' in `org.sonatype.aether.impl.internal.Utils#sortMetadataGeneratorFactories` ends up
        // being a list of nulls on windows and IBM's 1.6 JDK.
        deployer.setMetadataFactories(null);
        deployer.addMetadataGeneratorFactory(new VersionsMetadataGeneratorFactory());
        deployer.addMetadataGeneratorFactory(new SnapshotMetadataGeneratorFactory());
        deployer.addMetadataGeneratorFactory(snapshotVersionManager);
        return container.lookup(RepositorySystem.class);
    } catch (ComponentLookupException e) {
        throw UncheckedException.throwAsUncheckedException(e);
    }
}
Also used : SnapshotMetadataGeneratorFactory(org.apache.maven.repository.internal.SnapshotMetadataGeneratorFactory) VersionsMetadataGeneratorFactory(org.apache.maven.repository.internal.VersionsMetadataGeneratorFactory) ComponentLookupException(org.codehaus.plexus.component.repository.exception.ComponentLookupException) DefaultDeployer(org.sonatype.aether.impl.internal.DefaultDeployer) Deployer(org.sonatype.aether.impl.Deployer) DefaultDeployer(org.sonatype.aether.impl.internal.DefaultDeployer)

Aggregations

SnapshotMetadataGeneratorFactory (org.apache.maven.repository.internal.SnapshotMetadataGeneratorFactory)1 VersionsMetadataGeneratorFactory (org.apache.maven.repository.internal.VersionsMetadataGeneratorFactory)1 ComponentLookupException (org.codehaus.plexus.component.repository.exception.ComponentLookupException)1 Deployer (org.sonatype.aether.impl.Deployer)1 DefaultDeployer (org.sonatype.aether.impl.internal.DefaultDeployer)1