final ArtifactResolutionResult resolutionResult = this.artifactResolver.resolve( artifactResolutionRequest );
artifactResolver.resolve( projectArtifact, remoteArtifactRepositories, localRepository );
); try { artifactResolver.resolve( artifact, remoteRepositories, localRepository ); urls.add( artifact.getFile().toURI().toURL() );
private boolean resolve(org.apache.maven.artifact.Artifact mavenRootArtifact) { try { artifactResolver.resolve(mavenRootArtifact, remoteRepositories, localRepository); return true; } catch (ArtifactResolutionException ex) { return false; } catch (ArtifactNotFoundException ex) { return false; } }
public void resolve( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository ) throws ArtifactResolutionException, ArtifactNotFoundException { artifactResolver.resolve( artifact, remoteRepositories, localRepository ); }
public void resolveArtifact( Artifact artifact, boolean usePluginRepositories ) throws ArtifactResolutionException, ArtifactNotFoundException { List remoteRepositories = usePluginRepositories ? remotePluginRepositories : remoteArtifactRepositories; artifactResolver.resolve( artifact, remoteRepositories, localRepository ); }
public void resolveArtifact( Artifact artifact, boolean usePluginRepositories ) throws ArtifactResolutionException, ArtifactNotFoundException { List remoteRepositories = usePluginRepositories ? remotePluginRepositories : remoteArtifactRepositories; artifactResolver.resolve( artifact, remoteRepositories, localRepository ); }
protected final void resolveArtifacts(final Set<Artifact> artifacts) throws MojoExecutionException { for (final Artifact pluginA : artifacts) { try { resolver.resolve(pluginA, remoteRepos, localRepo); } catch (final ArtifactResolutionException e) { throw new MojoExecutionException("Failure Resolving Artifacts", e); } catch (final ArtifactNotFoundException e) { throw new MojoExecutionException("Failure Resolving Artifacts", e); } } }
private Artifact resolveArtifact(String groupId, String artifactId, String version, String type) throws Exception { Artifact art = artifactFactory.createArtifact(groupId, artifactId, version, "runtime", type); artifactResolver.resolve(art, remoteRepositories, localRepository); return art; }
@Deprecated public void resolve(final Artifact artifact, final List<ArtifactRepository> remoteRepositories, final ArtifactRepository localRepository) throws ArtifactResolutionException, ArtifactNotFoundException { assert delegate != null; assert repositoryManager != null; delegate.resolve(artifact, repositoryManager.selectRemoteRepositories(remoteRepositories), localRepository); }
/** * Downloads the platform-specific parts, if necessary. */ private void retrieveBinaryBits(Artifact a) throws MojoExecutionException { try { resolver.resolve(a, project.getRemoteArtifactRepositories(), localRepository); } catch (ArtifactNotFoundException e) { throw new MojoExecutionException("Can't find platform-specific components", e); } catch (ArtifactResolutionException e) { throw new MojoExecutionException("Can't retrieve platform-specific components", e); } }
/** * Resolves to the jar file that contains the code of the plugin. */ public File getFile() { if (artifact.getFile()==null) try { resolver.resolve(artifact, remoteRepositories, localRepository); } catch (AbstractArtifactResolutionException e) { throw new RuntimeException("Failed to resolve "+getId(),e); } return artifact.getFile(); }
public static Artifact getResolvedArtifact(String groupId, String artifactId, String version, String type, String scope) throws MojoExecutionException { Artifact artifact = MavenUtils.artifactFactory.createArtifact(groupId,artifactId,version,scope,type); try { MavenUtils.resolver.resolve(artifact,MavenUtils.remoteRepositories,MavenUtils.localRepository); } catch (ArtifactResolutionException e) { throw new MojoExecutionException("ERROR",e); } catch (ArtifactNotFoundException e) { throw new MojoExecutionException("ERROR",e); } return artifact; }
private File resolveArtifact( String groupId, String artifactId, String version, String type, String classifier, ArtifactRepository localRepository, List<ArtifactRepository> repositories ) throws ArtifactResolutionException, IOException, ArtifactNotFoundException { // TODO: this is a bit crude - proper type, or proper handling as metadata rather than an artifact in 2.1? Artifact artifact = artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, type, classifier ); artifactResolver.resolve( artifact, repositories, localRepository ); return artifact.getFile(); }
protected void addToClasspath(Artifact artifact, Set<String> classpath, boolean addDependencies) throws Exception { resolver.resolve(artifact, remoteRepos, localRepo); classpath.add(artifact.getFile().getCanonicalPath()); if (addDependencies) { for (Artifact dep : resolveArtifactDependencies(artifact)) { //classpath.add(dep.getFile().getCanonicalPath()); addToClasspath(dep, classpath, addDependencies); } } }
protected File resolve(ArtifactInfo a, String type, String classifier) throws AbstractArtifactResolutionException { Artifact artifact = af.createArtifactWithClassifier(a.groupId, a.artifactId, a.version, type, classifier); if (!new File(localRepo, local.pathOf(artifact)).isFile()) { System.err.println("Downloading " + artifact); } try { ar.resolve(artifact, remoteRepositories, local); } catch (RuntimeException e) { throw new ArtifactResolutionException(e.getMessage(), artifact); } return artifact.getFile(); }
private Artifact resolveExtAsArtifact(String version, String packaging) throws MojoExecutionException { Artifact toDownload = artifactFactory.createBuildArtifact("net.jangaroo", "ext-as", version, packaging); try { getLog().info("Resolving " + toDownload + "..."); artifactResolver.resolve(toDownload, remoteRepositories, localRepository); return toDownload; } catch (AbstractArtifactResolutionException e) { throw new MojoExecutionException("Couldn't download artifact: " + e.getMessage(), e); } }
public ArtifactResolutionResult resolve(final ArtifactResolutionRequest request) { assert request != null; assert delegate != null; assert repositoryManager != null; request.setRemoteRepostories(repositoryManager.selectRemoteRepositories(request.getRemoteRepostories())); return delegate.resolve(request); } }
public void resolveArtifacts(Collection<Artifact> artifacts) throws ArtifactNotFoundException, ArtifactResolutionException { for (Artifact artifact : artifacts) { getArtifactResolver().resolve(artifact, getProject().getRemoteArtifactRepositories(), getLocalRepository()); } }