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 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 InvocationResultWithOutput 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 InvocationResultWithOutput 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
    • invokeGoals

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