public Resolver(ArtifactConfig config) { this.modelBuilder = new DefaultModelBuilderFactory() .newInstance() .setProfileSelector(new DefaultProfileSelector()) .setPluginConfigurationExpander(new DefaultPluginConfigurationExpander()) .setPluginManagementInjector(new DefaultPluginManagementInjector()) .setDependencyManagementImporter(new DefaultDependencyManagementImporter()) .setDependencyManagementInjector(new DefaultDependencyManagementInjector()); ServiceLocator locator = AetherUtil.initServiceLocator(); this.repoSys = locator.getService(RepositorySystem.class); this.localRepo = new LocalRepository(Paths.get(config.mavenLocalRepo).toFile()); this.session = newSession(repoSys, localRepo); this.buckRepoRoot = Paths.get(Preconditions.checkNotNull(config.buckRepoRoot)); this.buckThirdPartyRelativePath = Paths.get(Preconditions.checkNotNull(config.thirdParty)); this.visibility = config.visibility; this.repos = config .repositories .stream() .map(AetherUtil::toRemoteRepository) .collect(ImmutableList.toImmutableList()); }
private DefaultProfileSelector createProfileSelector() { DefaultProfileSelector selector = new DefaultProfileSelector(); selector.addProfileActivator(new FileProfileActivator() .setPathTranslator(new DefaultPathTranslator())); selector.addProfileActivator(new JdkVersionProfileActivator()); selector.addProfileActivator(new PropertyProfileActivator()); selector.addProfileActivator(new OperatingSystemProfileActivator()); return selector; }
private DefaultProfileSelector createProfileSelector() { DefaultProfileSelector selector = new DefaultProfileSelector(); selector.addProfileActivator(new FileProfileActivator()); selector.addProfileActivator(new JdkVersionProfileActivator()); selector.addProfileActivator(new PropertyProfileActivator()); selector.addProfileActivator(new OperatingSystemProfileActivator()); return selector; }
protected ProfileSelector newProfileSelector() { DefaultProfileSelector profileSelector = new DefaultProfileSelector(); for ( ProfileActivator activator : newProfileActivators() ) { profileSelector.addProfileActivator( activator ); } return profileSelector; }