Interface Project

All Known Implementing Classes:
DefaultProject

@Experimental public interface Project
Interface representing a Maven project. Projects can be built using the ProjectBuilder service.
Since:
4.0.0
  • Method Details

    • getGroupId

      @Nonnull String getGroupId()
    • getArtifactId

      @Nonnull String getArtifactId()
    • getVersion

      @Nonnull String getVersion()
    • getPackaging

      @Nonnull String getPackaging()
    • getArtifact

      @Nonnull Artifact getArtifact()
    • getModel

      @Nonnull Model getModel()
    • getBuild

      @Nonnull default Build getBuild()
    • getPomPath

      @Nonnull Optional<Path> 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

      @Nonnull default Optional<Path> getBasedir()
    • getDependencies

      @Nonnull List<DependencyCoordinate> getDependencies()
    • getManagedDependencies

      @Nonnull List<DependencyCoordinate> getManagedDependencies()
    • getId

      @Nonnull default String getId()
    • isExecutionRoot

      @Deprecated boolean isExecutionRoot()
      Deprecated.
      use isTopProject() 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 the rootDirectory, 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 the getRootDirectory() and getBasedir() points to the same directory, and that either Model.isRoot() is true or that basedir contains a .mvn child directory.
      Returns:
      true if the project is the root project
      See Also:
    • getRootDirectory

      @Nonnull Path getRootDirectory()
      Gets the root directory of the project, which is the parent directory containing the .mvn directory or flagged with root="true".
      Throws:
      IllegalStateException - if the root directory could not be found
      See Also:
    • getParent

      @Nonnull Optional<Project> getParent()
    • getRemoteProjectRepositories

      @Nonnull List<RemoteRepository> getRemoteProjectRepositories()
    • getRemotePluginRepositories

      @Nonnull List<RemoteRepository> getRemotePluginRepositories()