@Component(role=ProjectInstaller.class) public class DefaultProjectInstaller extends Object implements ProjectInstaller
| Constructor and Description |
|---|
DefaultProjectInstaller() |
| Modifier and Type | Method and Description |
|---|---|
void |
install(ProjectBuildingRequest buildingRequest,
ProjectInstallerRequest request)
This will install a single project which may contain several artifacts.
|
public void install(ProjectBuildingRequest buildingRequest, ProjectInstallerRequest request) throws IOException, ArtifactInstallerException, NoFileAssignedException
@Parameter( defaultValue = "${session}", required=true, readonly = true)
private MavenSession session;
@Parameter( defaultValue = "${project}", required=true, readonly = true)
private MavenProject project;
..
@Component
private ProjectInstaller installer;
ProjectInstallerRequest pir =
new ProjectInstallerRequest()
.setProject( mavenProject )
.setCreateChecksum( false )
.setUpdateReleaseInfo( false );
installer.install( session.getProjectBuildingRequest(), pir );
To set a different local repository than the current one in the Maven session, you can inject an instance of
the RepositoryManager and set the path to the local repository, called
localRepositoryPath, as such:
@Component private RepositoryManager repositoryManager; buildingRequest = repositoryManager.setLocalRepositoryBasedir( buildingRequest, localRepositoryPath );
install in interface ProjectInstallerbuildingRequest - ProjectBuildingRequestrequest - ProjectInstallerRequestIOException - In case of problems related to checksums.ArtifactInstallerException - In case of problems to install artifacts.NoFileAssignedException - If no file has been assigned to the project.Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.