private static ArtifactResolver createArtifactResolver(ArtifactResolver artifactResolver, ArtifactManager artifactManager, Collection repositories) { if (artifactResolver != null) { return artifactResolver; } return new DefaultArtifactResolver(artifactManager, repositories, null); }
private Artifact getArtifactVersion(Collection artifacts, Artifact query) { for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) { Artifact artifact = (Artifact) iterator.next(); if (matches(artifact, query)) { return artifact; } } return null; }
public Artifact resolveInClassLoader(Artifact source) throws MissingDependencyException { return resolveInClassLoader(source, Collections.EMPTY_SET); }
if (matches(configuration.getId(), working)) { return configuration.getId(); if (environment.isInverseClassLoading()) { Artifact artifact = getArtifactVersion(configuration.getDependencies(), working); if (artifact != null) { return artifact; artifact = searchParents(configuration.getClassParents(), working); if (artifact != null) { return artifact; Artifact artifact = searchParents(configuration.getClassParents(), working); if (artifact != null) { return artifact; artifact = getArtifactVersion(configuration.getDependencies(), working); if (artifact != null) { return artifact;
public Artifact queryArtifact(Artifact artifact) throws MultipleMatchesException { Artifact[] all = queryArtifacts(artifact); if(all.length > 1) { throw new MultipleMatchesException(artifact); } return all.length == 0 ? null : all[0]; }
Artifact artifact = searchParents(parentConfigurations, working); if (artifact != null) { return artifact;
public Artifact resolveInClassLoader(Artifact source, Collection parentConfigurations) throws MissingDependencyException { // Some tests break if we acntually try to search for fully-resolved artifacts if(source.isResolved()) { return source; } // if (artifact.getType() == null) { // throw new IllegalArgumentException("Type not set " + artifact); // } // // String groupId = source.getGroupId(); // if (groupId == null) { // groupId = Artifact.DEFAULT_GROUP_ID; // } // Version version = source.getVersion(); Artifact working = resolveVersion(parentConfigurations, source); if (working == null || !working.isResolved()) { throw new MissingDependencyException("Unable to resolve dependency " + source); } return working; }
public LocalSourceRepository(File base) { super(base); artifactResolver = new DefaultArtifactResolver(new DefaultArtifactManager(), this); }
public LinkedHashSet resolveInClassLoader(Collection artifacts) throws MissingDependencyException { return resolveInClassLoader(artifacts, Collections.EMPTY_SET); }
Maven2Repository bootRepository = new Maven2Repository(new File(bootDirectory, repository)); repositories = Collections.singleton(bootRepository); artifactResolver = new DefaultArtifactResolver(new DefaultArtifactManager(), bootRepository); } else {
public LinkedHashSet resolveInClassLoader(Collection artifacts, Collection parentConfigurations) throws MissingDependencyException { LinkedHashSet resolvedArtifacts = new LinkedHashSet(); for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) { Artifact artifact = (Artifact) iterator.next(); if (!artifact.isResolved()) { artifact = resolveInClassLoader(artifact, parentConfigurations); } resolvedArtifacts.add(artifact); } return resolvedArtifacts; }