Package org.apache.maven.internal.impl
Class DefaultProject
java.lang.Object
org.apache.maven.internal.impl.DefaultProject
- All Implemented Interfaces:
- Project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the project artifactId.Returns the project artifacts as immutable list.Returns the project base directory, i.e.Returns the project direct dependencies (directly specified or inherited).Returns the project groupId.Returns the project managed dependencies (directly specified or inherited).getModel()Returns the project model.Returns the project packaging.Returns project parent project, if any.Returns the path to the pom file for this project.Gets the root directory of the project, which is the parent directory containing the.mvndirectory or flagged withroot="true".Returns the project version.booleanReturns a boolean indicating if the project is a root project, meaning that theProject.getRootDirectory()andProject.getBasedir()points to the same directory, and that eitherModel.isRoot()istrueor thatbasedircontains a.mvnchild directory.booleanReturns a boolean indicating if the project is the top level project for this reactor build.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.api.ProjectgetBuild, getId, getLanguage, getMainArtifact, getPomArtifact
- 
Constructor Details- 
DefaultProject
 
- 
- 
Method Details- 
getSession
- 
getProject
- 
getGroupIdDescription copied from interface:ProjectReturns the project groupId.- Specified by:
- getGroupIdin interface- Project
 
- 
getArtifactIdDescription copied from interface:ProjectReturns the project artifactId.- Specified by:
- getArtifactIdin interface- Project
 
- 
getVersionDescription copied from interface:ProjectReturns the project version.- Specified by:
- getVersionin interface- Project
 
- 
getArtifactsDescription copied from interface:ProjectReturns the project artifacts as immutable list. Elements are the project POM artifact and the artifact produced by this project build, if applicable. Hence, the returned list may have one or two elements (never less than 1, never more than 2), depending on project packaging.The list's first element is ALWAYS the project POM artifact. Presence of second element in the list depends solely on the project packaging. - Specified by:
- getArtifactsin interface- Project
- See Also:
 
- 
getPackagingDescription copied from interface:ProjectReturns the project packaging.Note: unlike in legacy code, logical checks against string representing packaging (returned by this method) are NOT recommended (code like "pom".equals(project.getPackaging)must be avoided). Use methodProject.getArtifacts()to gain access to POM or build artifact.- Specified by:
- getPackagingin interface- Project
- See Also:
 
- 
getModelDescription copied from interface:ProjectReturns the project model.
- 
getPomPathDescription copied from interface:ProjectReturns the path to the pom file for this project. A project is usually read from a file namedpom.xml, which contains the model in an XML form. When a customorg.apache.maven.api.spi.ModelParseris used, the path may point to a non XML file.The POM path is also used to define the base directory of the project. - Specified by:
- getPomPathin interface- Project
- Returns:
- the path of the pom
- See Also:
 
- 
getBasedirDescription copied from interface:ProjectReturns the project base directory, i.e. the directory containing the project. A project is usually read from the file system and this will point to the directory containing the POM file.- Specified by:
- getBasedirin interface- Project
- Returns:
- the path of the directory containing the project
 
- 
getDependenciesDescription copied from interface:ProjectReturns the project direct dependencies (directly specified or inherited).- Specified by:
- getDependenciesin interface- Project
 
- 
getManagedDependenciesDescription copied from interface:ProjectReturns the project managed dependencies (directly specified or inherited).- Specified by:
- getManagedDependenciesin interface- Project
 
- 
isTopProjectpublic boolean isTopProject()Description copied from interface:ProjectReturns a boolean indicating if the project is the top level project for this reactor build. The top level project may be different from therootDirectory, especially if a subtree of the project is being built, either because Maven has been launched in a subdirectory or using a-foption.- Specified by:
- isTopProjectin interface- Project
- Returns:
- trueif the project is the top level project for this build
 
- 
isRootProjectpublic boolean isRootProject()Description copied from interface:ProjectReturns a boolean indicating if the project is a root project, meaning that theProject.getRootDirectory()andProject.getBasedir()points to the same directory, and that eitherModel.isRoot()istrueor thatbasedircontains a.mvnchild directory.- Specified by:
- isRootProjectin interface- Project
- Returns:
- trueif the project is the root project
- See Also:
 
- 
getRootDirectoryDescription copied from interface:ProjectGets the root directory of the project, which is the parent directory containing the.mvndirectory or flagged withroot="true".- Specified by:
- getRootDirectoryin interface- Project
- See Also:
 
- 
getParentDescription copied from interface:ProjectReturns project parent project, if any.Note that the model may have a parent defined, but an empty parent project may be returned if the parent comes from a remote repository, as a Projectmust refer to a buildable project.
 
-