Class MavenEnvironment

java.lang.Object
io.helidon.build.devloop.maven.MavenEnvironment

public class MavenEnvironment extends Object
An accessor for various Maven components.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MavenEnvironment(org.apache.maven.project.MavenProject project, org.apache.maven.execution.MavenSession session, org.apache.maven.lifecycle.internal.MojoDescriptorCreator mojoDescriptorCreator, org.apache.maven.lifecycle.DefaultLifecycles defaultLifeCycles, org.apache.maven.lifecycle.LifecycleMappingDelegate standardLifecycleDelegate, Map<String,org.apache.maven.lifecycle.LifecycleMappingDelegate> lifecycleDelegates, org.apache.maven.plugin.BuildPluginManager buildPluginManager, org.apache.maven.lifecycle.internal.MojoExecutor mojoExecutor)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(org.apache.maven.plugin.MojoExecution execution)
    Execute a given mojo execution.
    org.apache.maven.plugin.MojoExecution
    execution(String pluginKey, String goal, String executionId)
    Create a mojo execution.
    goal(String prefix, String goal, String executionId)
    Create a new goal.
    org.apache.maven.lifecycle.Lifecycle
    Get the lifecycle for the given phase.
    phase(String phase)
    Resolve the goals for the lifecycle of the given phase.
    org.apache.maven.project.MavenProject
    Returns the project.
    org.apache.maven.execution.MavenSession
    Returns the session.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MavenEnvironment

      public MavenEnvironment(org.apache.maven.project.MavenProject project, org.apache.maven.execution.MavenSession session, org.apache.maven.lifecycle.internal.MojoDescriptorCreator mojoDescriptorCreator, org.apache.maven.lifecycle.DefaultLifecycles defaultLifeCycles, org.apache.maven.lifecycle.LifecycleMappingDelegate standardLifecycleDelegate, Map<String,org.apache.maven.lifecycle.LifecycleMappingDelegate> lifecycleDelegates, org.apache.maven.plugin.BuildPluginManager buildPluginManager, org.apache.maven.lifecycle.internal.MojoExecutor mojoExecutor)
      Constructor.
      Parameters:
      project - The project.
      session - The session.
      mojoDescriptorCreator - The mojo descriptor creator.
      defaultLifeCycles - The default lifecycles.
      standardLifecycleDelegate - The standard lifecycle mapping delegate.
      lifecycleDelegates - The lifecycle delegates, by phase.
      buildPluginManager - The build plugin manager.
      mojoExecutor - The mojo executor
  • Method Details

    • project

      public org.apache.maven.project.MavenProject project()
      Returns the project.
      Returns:
      The project.
    • session

      public org.apache.maven.execution.MavenSession session()
      Returns the session.
      Returns:
      The session.
    • execute

      public void execute(org.apache.maven.plugin.MojoExecution execution)
      Execute a given mojo execution.
      Parameters:
      execution - mojo execution
    • execution

      public org.apache.maven.plugin.MojoExecution execution(String pluginKey, String goal, String executionId)
      Create a mojo execution.
      Parameters:
      pluginKey - plugin key (pluginGroupId : pluginArtifactId)
      goal - plugin goal
      executionId - execution id
      Returns:
      MojoExecution
    • goal

      public MavenGoal goal(String prefix, String goal, String executionId) throws Exception
      Create a new goal.
      Parameters:
      prefix - plugin prefix
      goal - plugin goal
      executionId - execution id
      Returns:
      MavenGoal
      Throws:
      Exception - if the plugin is not found using the prefix
    • phase

      public List<MavenGoal> phase(String phase) throws Exception
      Resolve the goals for the lifecycle of the given phase.
      Parameters:
      phase - maven phase
      Returns:
      list of MavenGoal, never null
      Throws:
      org.apache.maven.lifecycle.LifecyclePhaseNotFoundException - if the phase is unknown
      Exception
    • lifecycle

      public org.apache.maven.lifecycle.Lifecycle lifecycle(String phase) throws Exception
      Get the lifecycle for the given phase.
      Parameters:
      phase - maven phase
      Returns:
      lifecycle, never null
      Throws:
      org.apache.maven.lifecycle.LifecyclePhaseNotFoundException - if the phase is unknown
      Exception