@Override public String toString() { return getArtifacts() + ", " + getMetadata(); }
@Override public String toString() { return getArtifacts() + ", " + getMetadata(); }
/** * 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(); } }
/** * 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(); } }
public void installArtifact(String groupId, String artifactId, String ext, String classifier, String version, File artifactFile, File pomFile) throws Exception { Artifact jarArtifact = new DefaultArtifact(groupId, artifactId, classifier, ext, version); jarArtifact = jarArtifact.setFile(artifactFile); Artifact pomArtifact = new SubArtifact(jarArtifact, "", "pom"); pomArtifact = pomArtifact.setFile(pomFile); InstallRequest installRequest = new InstallRequest(); installRequest.addArtifact(jarArtifact ).addArtifact( pomArtifact ); InstallResult result = system.install(session, installRequest); if (!result.getArtifacts().contains(jarArtifact)) { throw new AssertionError("Could not install jar " + jarArtifact); } if (!result.getArtifacts().contains(pomArtifact)) { throw new AssertionError("Could not install pom " + jarArtifact); } }
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; } }