use of org.eclipse.aether.installation.InstallRequest 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();
}
use of org.eclipse.aether.installation.InstallRequest 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);
}
}
});
}
use of org.eclipse.aether.installation.InstallRequest in project kie-wb-common by kiegroup.
the class MavenDependencyConfigExecutorTest method installArtifactLocally.
private void installArtifactLocally(final String groupId, final String artifactId, final String version) throws Exception {
Artifact pomArtifact = new DefaultArtifact(groupId, artifactId, "pom", version);
final Path pom = getPom(groupId, artifactId, version);
pomArtifact = pomArtifact.setFile(pom.toFile());
final InstallRequest installRequest = new InstallRequest();
installRequest.addArtifact(pomArtifact);
final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
RepositorySystem system = locator.getService(RepositorySystem.class);
final DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
final LocalRepository localRepo = new LocalRepository(m2Folder);
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
system.install(session, installRequest);
}
Aggregations