use of org.eclipse.tycho.core.resolver.shared.MavenRepositoryLocation in project tycho by eclipse.
the class TargetPlatformFactoryImpl method gatherExternalInstallableUnits.
/**
* External installable units collected from p2 repositories, .target files and local Maven
* repository.
*/
private LinkedHashSet<IInstallableUnit> gatherExternalInstallableUnits(Set<MavenRepositoryLocation> completeRepositories, List<TargetDefinitionContent> targetDefinitionsContent, PomDependencyCollectorImpl pomDependenciesContent, boolean includeLocalMavenRepo) {
LinkedHashSet<IInstallableUnit> result = new LinkedHashSet<>();
for (TargetDefinitionContent targetDefinitionContent : targetDefinitionsContent) {
result.addAll(targetDefinitionContent.getUnits());
}
List<IMetadataRepository> metadataRepositories = new ArrayList<>();
for (MavenRepositoryLocation location : completeRepositories) {
metadataRepositories.add(loadMetadataRepository(location));
}
if (includeLocalMavenRepo) {
metadataRepositories.add(localMetadataRepository);
}
for (IMetadataRepository repository : metadataRepositories) {
IQueryResult<IInstallableUnit> matches = repository.query(QueryUtil.ALL_UNITS, monitor);
result.addAll(matches.toUnmodifiableSet());
}
result.addAll(pomDependenciesContent.gatherMavenInstallableUnits());
if (includeLocalMavenRepo && logger.isDebugEnabled()) {
IQueryResult<IInstallableUnit> locallyInstalledIUs = localMetadataRepository.query(QueryUtil.ALL_UNITS, null);
logger.debug("Added " + countElements(locallyInstalledIUs.iterator()) + " locally built units to the target platform");
}
return result;
}
use of org.eclipse.tycho.core.resolver.shared.MavenRepositoryLocation in project tycho by eclipse.
the class RemoteRepositoryLoadingHelper method getEffectiveLocationAndPrepareLoad.
public URI getEffectiveLocationAndPrepareLoad(URI location) throws ProvisionException {
if (certainlyNoRemoteURL(location)) {
return location;
}
MavenRepositoryLocation effectiveLocation = effectiveLocationFor(location, true);
setPasswordForLoading(effectiveLocation);
return effectiveLocation.getURL();
}
use of org.eclipse.tycho.core.resolver.shared.MavenRepositoryLocation in project tycho by eclipse.
the class RemoteRepositoryLoadingHelper method effectiveLocationFor.
private MavenRepositoryLocation effectiveLocationFor(URI location, boolean forLoading) {
URI normalizedLocation = normalize(location);
String id = knownMavenRepositoryIds.get(normalizedLocation);
if (id == null) {
// fall back to URL as ID
id = normalizedLocation.toString();
}
MavenRepositoryLocation locationWithID = new MavenRepositoryLocation(id, normalizedLocation);
MavenRepositoryLocation mirror = settings.getMirror(locationWithID);
if (mirror != null) {
if (forLoading) {
logger.info("Loading repository '" + id + "' from mirror '" + mirror.getId() + "' at '" + mirror.getURL() + "'");
}
return mirror;
} else {
return locationWithID;
}
}
Aggregations