Package org.apache.maven.internal.impl
Class DefaultProjectManager
java.lang.Object
org.apache.maven.internal.impl.DefaultProjectManager
- All Implemented Interfaces:
- Service,- ProjectManager
@Named
@Typed
@SessionScoped
public class DefaultProjectManager
extends Object
implements ProjectManager
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultProjectManager(InternalMavenSession session, ArtifactManager artifactManager) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCompileSourceRoot(Project project, ProjectScope scope, Path sourceRoot) Add a compilation source root to the given project for the given scope.voidaddResource(Project project, ProjectScope scope, Resource resource) Add a resource set to the given project for the given scope.voidattachArtifact(Project project, ProducedArtifact artifact, Path path) getAllArtifacts(Project project) Returns project's all artifacts as immutable collection.getAttachedArtifacts(Project project) Returns an immutable collection of attached artifacts for given project.getCompileSourceRoots(Project project, ProjectScope scope) Obtain an immutable list of compile source roots for the given project and scope.getExecutionProject(Project project) Returns the path to the built project artifact file, if the project has been built.getProperties(Project project) Returns an immutable map of the project properties.getRemotePluginRepositories(Project project) Returns an immutable list of project remote plugin repositories (directly specified or inherited).getRemoteProjectRepositories(Project project) Returns an immutable list of project remote repositories (directly specified or inherited).getResources(Project project, ProjectScope scope) Get the list of resources for the given project and scopevoidsetProperty(Project project, String key, String value) Set a given project property.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.api.services.ProjectManagerattachArtifact, attachArtifact
- 
Constructor Details- 
DefaultProjectManager
 
- 
- 
Method Details- 
getPathDescription copied from interface:ProjectManagerReturns the path to the built project artifact file, if the project has been built.- Specified by:
- getPathin interface- ProjectManager
- Returns:
- the path of the built project artifact
 
- 
getAttachedArtifactsDescription copied from interface:ProjectManagerReturns an immutable collection of attached artifacts for given project.- Specified by:
- getAttachedArtifactsin interface- ProjectManager
 
- 
getAllArtifactsDescription copied from interface:ProjectManagerReturns project's all artifacts as immutable collection. The list contains all artifacts, even the attached ones, if any. Hence, the list returned by this method depends on which lifecycle step of the build was it invoked. The head of returned list is result ofProject.getArtifacts()method, so same applies here: the list can have minimum of one element. The maximum number of elements is in turn dependent on build configuration and lifecycle phase when this method was invoked (i.e. is javadoc jar built and attached, is sources jar built attached, are all the artifact signed, etc.).This method is shorthand for Project.getArtifacts()andProjectManager.getAttachedArtifacts(Project)methods.- Specified by:
- getAllArtifactsin interface- ProjectManager
- See Also:
 
- 
attachArtifact- Specified by:
- attachArtifactin interface- ProjectManager
 
- 
getCompileSourceRootsDescription copied from interface:ProjectManagerObtain an immutable list of compile source roots for the given project and scope. Paths are absolute.- Specified by:
- getCompileSourceRootsin interface- ProjectManager
- Parameters:
- project- the project
- scope- the scope, i.e. usually main or test
- Returns:
- the list of compile source roots
 
- 
addCompileSourceRootDescription copied from interface:ProjectManagerAdd a compilation source root to the given project for the given scope. The path will be transformed into an absolute path and added to the list for the given scope, if not already present.- Specified by:
- addCompileSourceRootin interface- ProjectManager
- Parameters:
- project- the project
- scope- the scope, i.e. usually main or test
- sourceRoot- the new source root
 
- 
getResourcesDescription copied from interface:ProjectManagerGet the list of resources for the given project and scope- Specified by:
- getResourcesin interface- ProjectManager
- Parameters:
- project- the project
- scope- the scope, i.e. usually main or test
- Returns:
- the list of resources
 
- 
addResourcepublic void addResource(@Nonnull Project project, @Nonnull ProjectScope scope, @Nonnull Resource resource) Description copied from interface:ProjectManagerAdd a resource set to the given project for the given scope.- Specified by:
- addResourcein interface- ProjectManager
- Parameters:
- project- the project
- scope- the scope, i.e. usually main or test
- resource- the resource set to add
 
- 
getRemoteProjectRepositoriesDescription copied from interface:ProjectManagerReturns an immutable list of project remote repositories (directly specified or inherited).- Specified by:
- getRemoteProjectRepositoriesin interface- ProjectManager
- Parameters:
- project- the project
 
- 
getRemotePluginRepositoriesDescription copied from interface:ProjectManagerReturns an immutable list of project remote plugin repositories (directly specified or inherited).- Specified by:
- getRemotePluginRepositoriesin interface- ProjectManager
- Parameters:
- project- the project
 
- 
setPropertyDescription copied from interface:ProjectManagerSet a given project property.- Specified by:
- setPropertyin interface- ProjectManager
- Parameters:
- project- the project to modify
- key- they property's key
- value- the value or- nullto unset the property
 
- 
getPropertiesDescription copied from interface:ProjectManagerReturns an immutable map of the project properties.- Specified by:
- getPropertiesin interface- ProjectManager
- See Also:
 
- 
getExecutionProject- Specified by:
- getExecutionProjectin interface- ProjectManager
 
 
-