use of org.sonatype.aether.installation.InstallRequest in project gradle by gradle.
the class MavenInstallAction method publishArtifacts.
@Override
protected void publishArtifacts(Collection<Artifact> artifacts, RepositorySystem repositorySystem, RepositorySystemSession session) throws InstallationException {
InstallRequest request = new InstallRequest();
for (Artifact artifact : artifacts) {
request.addArtifact(artifact);
}
repositorySystem.install(session, request);
}
use of org.sonatype.aether.installation.InstallRequest in project sonatype-aether by sonatype.
the class DefaultInstallerTest method testNullMetadataFile.
@Test(expected = InstallationException.class)
public void testNullMetadataFile() throws InstallationException {
InstallRequest request = new InstallRequest();
request.addMetadata(metadata.setFile(null));
installer.install(session, request);
}
use of org.sonatype.aether.installation.InstallRequest in project sonatype-aether by sonatype.
the class DefaultInstallerTest method testSuccessfulArtifactEvents.
@Test
public void testSuccessfulArtifactEvents() throws InstallationException {
InstallRequest request = new InstallRequest();
request.addArtifact(artifact);
installer.install(session, request);
checkEvents("Repository Event problem", artifact, false);
}
use of org.sonatype.aether.installation.InstallRequest in project sonatype-aether by sonatype.
the class Aether method install.
public void install(Artifact artifact, Artifact pom) throws InstallationException {
RepositorySystemSession session = newSession();
InstallRequest installRequest = new InstallRequest();
installRequest.addArtifact(artifact).addArtifact(pom);
repositorySystem.install(session, installRequest);
}
use of org.sonatype.aether.installation.InstallRequest in project sonatype-aether by sonatype.
the class InstallArtifacts method main.
public static void main(String[] args) throws Exception {
System.out.println("------------------------------------------------------------");
System.out.println(InstallArtifacts.class.getSimpleName());
RepositorySystem system = Booter.newRepositorySystem();
RepositorySystemSession session = Booter.newRepositorySystemSession(system);
Artifact jarArtifact = new DefaultArtifact("test", "demo", "", "jar", "0.1-SNAPSHOT");
jarArtifact = jarArtifact.setFile(new File("demo.jar"));
Artifact pomArtifact = new SubArtifact(jarArtifact, "", "pom");
pomArtifact = pomArtifact.setFile(new File("pom.xml"));
InstallRequest installRequest = new InstallRequest();
installRequest.addArtifact(jarArtifact).addArtifact(pomArtifact);
system.install(session, installRequest);
}
Aggregations