Package org.apache.maven.api
Interface Project
Interface representing a Maven project.
Projects can be built using the
ProjectBuilder
service.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault Build
getBuild()
default String
getId()
getModel()
Returns the path to the pom file for this project.Gets the root directory of the project, which is the parent directory containing the.mvn
directory or flagged withroot="true"
.boolean
Deprecated.boolean
Returns a boolean indicating if the project is a root project, meaning that thegetRootDirectory()
andgetBasedir()
points to the same directory, and that eitherModel.isRoot()
istrue
or thatbasedir
contains a.mvn
child directory.boolean
Returns a boolean indicating if the project is the top level project for this reactor build.
-
Method Details
-
getGroupId
-
getArtifactId
-
getVersion
-
getPackaging
-
getArtifact
-
getModel
-
getBuild
-
getPomPath
Returns the path to the pom file for this project. A project is usually read from the file system and this will point to the file. In some cases, a transient project can be created which will not point to an actual pom file.- Returns:
- the path of the pom
-
getBasedir
-
getDependencies
-
getManagedDependencies
-
getId
-
isExecutionRoot
Deprecated.useisTopProject()
instead -
isTopProject
boolean isTopProject()Returns 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-f
option.- Returns:
true
if the project is the top level project for this build
-
isRootProject
boolean isRootProject()Returns a boolean indicating if the project is a root project, meaning that thegetRootDirectory()
andgetBasedir()
points to the same directory, and that eitherModel.isRoot()
istrue
or thatbasedir
contains a.mvn
child directory.- Returns:
true
if the project is the root project- See Also:
-
getRootDirectory
Gets the root directory of the project, which is the parent directory containing the.mvn
directory or flagged withroot="true"
.- Throws:
IllegalStateException
- if the root directory could not be found- See Also:
-
getParent
-
getRemoteProjectRepositories
-
getRemotePluginRepositories
-
isTopProject()
instead