private RepositorySystem newRepositorySystem() {
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

    return locator.getService(RepositorySystem.class);
  }
Esempio n. 2
0
  static RepositorySystem newRepositorySystem() {
    /*
     * Aether's components implement
     * org.sonatype.aether.spi.locator.Service to ease manual wiring and
     * using the prepopulated DefaultServiceLocator, we only need to
     * register the repository connector factories.
     */

    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);
    locator.setErrorHandler(new MyErrorHandler());

    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    // locator.addService(TransporterFactory.class, WagonTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

    return locator.getService(RepositorySystem.class);
  }