Package io.helidon.build.devloop.maven
Class MavenEnvironment
java.lang.Object
io.helidon.build.devloop.maven.MavenEnvironment
An accessor for various Maven components.
-
Constructor Summary
ConstructorsConstructorDescriptionMavenEnvironment(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 TypeMethodDescriptionvoidexecute(org.apache.maven.plugin.MojoExecution execution) Execute a given mojo execution.org.apache.maven.plugin.MojoExecutionCreate a mojo execution.Create a new goal.org.apache.maven.lifecycle.LifecycleGet the lifecycle for the given phase.Resolve the goals for the lifecycle of the given phase.org.apache.maven.project.MavenProjectproject()Returns the project.org.apache.maven.execution.MavenSessionsession()Returns the session.
-
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 goalexecutionId- execution id- Returns:
- MojoExecution
-
goal
Create a new goal.- Parameters:
prefix- plugin prefixgoal- plugin goalexecutionId- execution id- Returns:
- MavenGoal
- Throws:
Exception- if the plugin is not found using the prefix
-
phase
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 unknownException
-
lifecycle
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 unknownException
-