Search in sources :

Example 1 with InstallResult

use of org.eclipse.aether.installation.InstallResult in project unleash-maven-plugin by shillner.

the class ArtifactInstaller method installArtifacts.

/**
 * Installs the given artifacts into the local Maven repository.
 *
 * @param artifacts the artifacts to install.
 * @return the artifacts that have been installed successfully.
 * @throws InstallationException if anything goes wrong during the installation process.
 */
public Collection<Artifact> installArtifacts(Collection<Artifact> artifacts) throws InstallationException {
    InstallRequest request = new InstallRequest();
    request.setArtifacts(artifacts);
    InstallResult result = this.installer.install(this.repoSession, request);
    return result.getArtifacts();
}
Also used : InstallRequest(org.eclipse.aether.installation.InstallRequest) InstallResult(org.eclipse.aether.installation.InstallResult)

Example 2 with InstallResult

use of org.eclipse.aether.installation.InstallResult in project ceylon by eclipse.

the class Bug2414 method bug.

public static void bug(Artifact jarArtifact) {
    // locator.getService(RepositorySystem.class);
    final RepositorySystem system = null;
    // MavenRepositorySystemUtils.newSession();
    final DefaultRepositorySystemSession session = null;
    ModuleCopycat copycat = new ModuleCopycat(rmb.buildManager(), new RepositoryManager() {

        @Override
        public void putArtifact(ArtifactContext artifactContext, File file) throws RepositoryException {
            try {
                InstallRequest installRequest = new InstallRequest();
                installRequest.addArtifact(jarArtifact);
                InstallResult result = system.install(session, installRequest);
            } catch (InstallationException e) {
                throw new RepositoryException(e);
            }
        }
    });
}
Also used : RepositorySystem(org.eclipse.aether.RepositorySystem) DefaultRepositorySystemSession(org.eclipse.aether.DefaultRepositorySystemSession) InstallRequest(org.eclipse.aether.installation.InstallRequest) InstallationException(org.eclipse.aether.installation.InstallationException) RepositoryException(org.eclipse.ceylon.model.cmr.RepositoryException) ModuleCopycat(org.eclipse.ceylon.cmr.ceylon.ModuleCopycat) InstallResult(org.eclipse.aether.installation.InstallResult)

Example 3 with InstallResult

use of org.eclipse.aether.installation.InstallResult in project kie-wb-common by kiegroup.

the class MavenArtifactResolverTest method deployTestJar.

private boolean deployTestJar(Artifact jarArtifact, RepositorySystemSession session) throws InstallationException {
    final InstallRequest installRequest = new InstallRequest();
    installRequest.addArtifact(jarArtifact);
    InstallResult result = Aether.getAether().getSystem().install(session, installRequest);
    return result.getArtifacts().size() == 1;
}
Also used : InstallRequest(org.eclipse.aether.installation.InstallRequest) InstallResult(org.eclipse.aether.installation.InstallResult)

Aggregations

InstallRequest (org.eclipse.aether.installation.InstallRequest)3 InstallResult (org.eclipse.aether.installation.InstallResult)3 DefaultRepositorySystemSession (org.eclipse.aether.DefaultRepositorySystemSession)1 RepositorySystem (org.eclipse.aether.RepositorySystem)1 InstallationException (org.eclipse.aether.installation.InstallationException)1 ModuleCopycat (org.eclipse.ceylon.cmr.ceylon.ModuleCopycat)1 RepositoryException (org.eclipse.ceylon.model.cmr.RepositoryException)1