Package org.apache.maven.project
Class DefaultProjectBuildingHelper
java.lang.Object
org.apache.maven.project.DefaultProjectBuildingHelper
- All Implemented Interfaces:
ProjectBuildingHelper
@Named
@Singleton
public class DefaultProjectBuildingHelper
extends Object
implements ProjectBuildingHelper
Assists the project builder. Warning: This is an internal utility class that is only public for
technical reasons, it is not part of the public API. In particular, this class can be changed or deleted without
prior notice.
- Author:
- Benjamin Bentmann
-
Constructor Summary
ConstructorDescriptionDefaultProjectBuildingHelper
(org.codehaus.plexus.PlexusContainer container, ClassRealmManager classRealmManager, ProjectRealmCache projectRealmCache, MavenRepositorySystem repositorySystem, MavenPluginManager pluginManager) -
Method Summary
Modifier and TypeMethodDescriptioncreateArtifactRepositories
(List<Repository> pomRepositories, List<ArtifactRepository> externalRepositories, ProjectBuildingRequest request) Creates the effective artifact repositories from the specified POM repositories.createProjectRealm
(MavenProject project, Model model, ProjectBuildingRequest request) Creates the project realm that hosts the build extensions of the specified model.void
selectProjectRealm
(MavenProject project) Updates the context class loader such that the container will search the project realm when the model builder injects the lifecycle bindings from the packaging in the next step.
-
Constructor Details
-
DefaultProjectBuildingHelper
@Inject public DefaultProjectBuildingHelper(org.codehaus.plexus.PlexusContainer container, ClassRealmManager classRealmManager, ProjectRealmCache projectRealmCache, MavenRepositorySystem repositorySystem, MavenPluginManager pluginManager)
-
-
Method Details
-
createArtifactRepositories
public List<ArtifactRepository> createArtifactRepositories(List<Repository> pomRepositories, List<ArtifactRepository> externalRepositories, ProjectBuildingRequest request) throws InvalidRepositoryException Description copied from interface:ProjectBuildingHelper
Creates the effective artifact repositories from the specified POM repositories.- Specified by:
createArtifactRepositories
in interfaceProjectBuildingHelper
- Parameters:
pomRepositories
- The POM repositories to create the artifact repositories from, must not benull
.externalRepositories
- The external (and already mirrored) repositories to merge into the result list, may benull
.request
- The project building request holding further settings like repository settings, must not benull
.- Returns:
- The effective artifact repositories, never
null
. - Throws:
InvalidRepositoryException
-
createProjectRealm
public ProjectRealmCache.CacheRecord createProjectRealm(MavenProject project, Model model, ProjectBuildingRequest request) throws PluginResolutionException, PluginVersionResolutionException, PluginManagerException Description copied from interface:ProjectBuildingHelper
Creates the project realm that hosts the build extensions of the specified model.- Specified by:
createProjectRealm
in interfaceProjectBuildingHelper
- Parameters:
project
- The project to create the project realm for, must not benull
model
- The model to create the project realm for, must not benull
request
- The project building request holding further settings like repository settings, must not benull
.- Returns:
- The record with the project realm and extension artifact filter, never
null
. - Throws:
PluginResolutionException
- If any build extension could not be resolved.PluginVersionResolutionException
PluginManagerException
-
selectProjectRealm
Description copied from interface:ProjectBuildingHelper
Updates the context class loader such that the container will search the project realm when the model builder injects the lifecycle bindings from the packaging in the next step. The context class loader is to be reset by the project builder when the project is fully assembled.- Specified by:
selectProjectRealm
in interfaceProjectBuildingHelper
- Parameters:
project
- The project whose class realm should be selected, must not benull
.
-