use of org.gradle.internal.resolve.ModuleVersionResolveException in project gradle by gradle.
the class DefaultIncludedBuildExecuter method checkNoCycles.
private void checkNoCycles(BuildRequest buildRequest, BuildIdentifier target, List<BuildIdentifier> candidateCycle) {
candidateCycle.add(target);
for (BuildRequest executingBuild : executingBuilds) {
if (executingBuild.requestingBuild.equals(target)) {
BuildIdentifier nextTarget = executingBuild.targetBuild;
if (nextTarget.equals(buildRequest.requestingBuild)) {
candidateCycle.add(nextTarget);
ProjectComponentSelector selector = DefaultProjectComponentSelector.newSelector(buildRequest.targetBuild, ":");
throw new ModuleVersionResolveException(selector, "Included build dependency cycle: " + reportCycle(candidateCycle));
}
checkNoCycles(buildRequest, nextTarget, candidateCycle);
}
}
candidateCycle.remove(target);
}
use of org.gradle.internal.resolve.ModuleVersionResolveException in project gradle by gradle.
the class ProjectDependencyResolver method resolve.
@Override
public void resolve(DependencyMetadata dependency, BuildableComponentIdResolveResult result) {
if (dependency.getSelector() instanceof ProjectComponentSelector) {
ProjectComponentSelector selector = (ProjectComponentSelector) dependency.getSelector();
ProjectComponentIdentifier project = componentIdentifierFactory.createProjectComponentIdentifier(selector);
LocalComponentMetadata componentMetaData = localComponentRegistry.getComponent(project);
if (componentMetaData == null) {
result.failed(new ModuleVersionResolveException(selector, project + " not found."));
} else {
result.resolved(componentMetaData);
}
}
}
use of org.gradle.internal.resolve.ModuleVersionResolveException in project gradle by gradle.
the class DependencySubstitutionResolver method resolve.
public void resolve(DependencyMetadata dependency, BuildableComponentIdResolveResult result) {
ComponentSelector selector = dependency.getSelector();
DependencySubstitutionInternal details = new DefaultDependencySubstitution(selector, dependency.getRequested());
try {
rule.execute(details);
} catch (Throwable e) {
result.failed(new ModuleVersionResolveException(selector, e));
return;
}
if (details.isUpdated()) {
resolver.resolve(dependency.withTarget(details.getTarget()), result);
result.setSelectionReason(details.getSelectionReason());
return;
}
resolver.resolve(dependency, result);
}
use of org.gradle.internal.resolve.ModuleVersionResolveException in project gradle by gradle.
the class DynamicVersionResolver method resolve.
public void resolve(DependencyMetadata dependency, BuildableComponentIdResolveResult result) {
ModuleVersionSelector requested = dependency.getRequested();
LOGGER.debug("Attempting to resolve version for {} using repositories {}", requested, repositoryNames);
List<Throwable> errors = new ArrayList<Throwable>();
List<RepositoryResolveState> resolveStates = new ArrayList<RepositoryResolveState>();
for (ModuleComponentRepository repository : repositories) {
resolveStates.add(new RepositoryResolveState(dependency, repository));
}
final RepositoryChainModuleResolution latestResolved = findLatestModule(resolveStates, errors);
if (latestResolved != null) {
LOGGER.debug("Using {} from {}", latestResolved.module.getId(), latestResolved.repository);
for (Throwable error : errors) {
LOGGER.debug("Discarding resolve failure.", error);
}
result.resolved(metaDataFactory.transform(latestResolved));
return;
}
if (!errors.isEmpty()) {
result.failed(new ModuleVersionResolveException(requested, errors));
} else {
notFound(result, requested, resolveStates);
}
}
use of org.gradle.internal.resolve.ModuleVersionResolveException in project gradle by gradle.
the class DynamicVersionResolver method resolve.
public void resolve(ModuleDependencyMetadata dependency, VersionSelector versionSelector, VersionSelector rejectedVersionSelector, BuildableComponentIdResolveResult result) {
ModuleComponentSelector requested = dependency.getSelector();
LOGGER.debug("Attempting to resolve version for {} using repositories {}", requested, repositoryNames);
List<Throwable> errors = new ArrayList<Throwable>();
List<RepositoryResolveState> resolveStates = Lists.newArrayListWithCapacity(repositories.size());
for (ModuleComponentRepository repository : repositories) {
resolveStates.add(new RepositoryResolveState(versionedComponentChooser, dependency, repository, versionSelector, rejectedVersionSelector));
}
final RepositoryChainModuleResolution latestResolved = findLatestModule(resolveStates, errors);
if (latestResolved != null) {
LOGGER.debug("Using {} from {}", latestResolved.module.getModuleVersionId(), latestResolved.repository);
for (Throwable error : errors) {
LOGGER.debug("Discarding resolve failure.", error);
}
result.resolved(metaDataFactory.transform(latestResolved));
return;
}
if (!errors.isEmpty()) {
result.failed(new ModuleVersionResolveException(requested, errors));
} else {
notFound(result, requested, resolveStates);
}
}
Aggregations