Class ExecutorService

java.lang.Object
io.micronaut.maven.services.ExecutorService

@Singleton public class ExecutorService extends Object
Provides methods to execute goals on the current project.
Since:
1.1
Author:
Álvaro Sánchez-Mariscal
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExecutorService(org.apache.maven.project.MavenProject mavenProject, org.apache.maven.execution.MavenSession mavenSession, org.apache.maven.plugin.BuildPluginManager pluginManager, org.apache.maven.shared.invoker.Invoker invoker)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    executeGoal(String pluginKey, String goal)
    Executes the given goal from the given plugin coordinates.
    void
    executeGoal(String pluginGroup, String pluginArtifact, String pluginVersion, String goal, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
    Executes a goal using the given arguments.
    org.apache.maven.shared.invoker.InvocationResult
    invokeGoal(String pluginKey, String goal)
    Executes a goal using the Maven shared invoker.
    org.apache.maven.shared.invoker.InvocationResult
    invokeGoals(String... goals)
    Executes a goal using the Maven shared invoker.

    Methods inherited from class java.lang.Object

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

    • ExecutorService

      @Inject public ExecutorService(org.apache.maven.project.MavenProject mavenProject, org.apache.maven.execution.MavenSession mavenSession, org.apache.maven.plugin.BuildPluginManager pluginManager, org.apache.maven.shared.invoker.Invoker invoker)
  • Method Details

    • executeGoal

      public void executeGoal(String pluginKey, String goal) throws org.apache.maven.plugin.MojoExecutionException
      Executes the given goal from the given plugin coordinates.
      Parameters:
      pluginKey - The plugin coordinates in the format groupId:artifactId:version
      goal - The goal to execute
      Throws:
      org.apache.maven.plugin.MojoExecutionException - If the goal execution fails
    • executeGoal

      public void executeGoal(String pluginGroup, String pluginArtifact, String pluginVersion, String goal, org.codehaus.plexus.util.xml.Xpp3Dom configuration) throws org.apache.maven.plugin.MojoExecutionException
      Executes a goal using the given arguments.
      Parameters:
      pluginGroup - plugin group id
      pluginArtifact - plugin artifact id
      pluginVersion - plugin version
      goal - goal to execute
      configuration - configuration for the goal
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the goal execution fails
    • invokeGoal

      public org.apache.maven.shared.invoker.InvocationResult invokeGoal(String pluginKey, String goal) throws org.apache.maven.shared.invoker.MavenInvocationException
      Executes a goal using the Maven shared invoker.
      Parameters:
      pluginKey - The plugin coordinates in the format groupId:artifactId
      goal - The goal to execute
      Returns:
      The result of the invocation
      Throws:
      org.apache.maven.shared.invoker.MavenInvocationException - If the goal execution fails
    • invokeGoals

      public org.apache.maven.shared.invoker.InvocationResult invokeGoals(String... goals) throws org.apache.maven.shared.invoker.MavenInvocationException
      Executes a goal using the Maven shared invoker.
      Parameters:
      goals - The goals to execute
      Returns:
      The result of the invocation
      Throws:
      org.apache.maven.shared.invoker.MavenInvocationException - If the goal execution fails