/** * 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 a file as artifact to a local repository. * * @param spec <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version> * @param file artifact file * @throws InstallationException */ public void install(String spec, File file) throws InstallationException { InstallRequest request = new InstallRequest(); Artifact artifact = new DefaultArtifact(spec).setFile(file); request.setArtifacts(ImmutableList.of(artifact)); repositorySystem.install(session, request); }
/** * 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(); } }