Example usage for org.apache.maven.repository.internal VersionsMetadataGeneratorFactory VersionsMetadataGeneratorFactory

List of usage examples for org.apache.maven.repository.internal VersionsMetadataGeneratorFactory VersionsMetadataGeneratorFactory

Introduction

In this page you can find the example usage for org.apache.maven.repository.internal VersionsMetadataGeneratorFactory VersionsMetadataGeneratorFactory.

Prototype

VersionsMetadataGeneratorFactory

Source Link

Usage

From source file:org.gradle.api.publication.maven.internal.action.AbstractMavenPublishAction.java

License:Apache License

private RepositorySystem newRepositorySystem() {
    try {//from w w  w  . j ava  2  s.c o m
        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);
    }
}