Class DefaultProjectInstaller
- java.lang.Object
-
- org.apache.maven.shared.project.install.internal.DefaultProjectInstaller
-
- All Implemented Interfaces:
ProjectInstaller
@Component(role=ProjectInstaller.class) public class DefaultProjectInstaller extends java.lang.Object implements ProjectInstaller
This will install a whole project into the appropriate repository.- Author:
- Karl Heinz Marbaise khmarbaise@apache.org
-
-
Constructor Summary
Constructors Constructor Description DefaultProjectInstaller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinstall(org.apache.maven.project.ProjectBuildingRequest buildingRequest, ProjectInstallerRequest request)This will install a single project which may contain several artifacts.
-
-
-
Method Detail
-
install
public void install(org.apache.maven.project.ProjectBuildingRequest buildingRequest, ProjectInstallerRequest request) throws java.io.IOException, ArtifactInstallerException, NoFileAssignedExceptionThis will install a single project which may contain several artifacts. Those artifacts will be installed into the appropriate repository.@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 theRepositoryManagerand set the path to the local repository, calledlocalRepositoryPath, as such:@Component private RepositoryManager repositoryManager; buildingRequest = repositoryManager.setLocalRepositoryBasedir( buildingRequest, localRepositoryPath );
- Specified by:
installin interfaceProjectInstaller- Parameters:
buildingRequest-ProjectBuildingRequestrequest-ProjectInstallerRequest- Throws:
java.io.IOException- 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.
-
-