Class MavenGoal

  • All Implemented Interfaces:
    BuildStep

    public class MavenGoal
    extends Object
    implements BuildStep
    An executable maven goal. Executions occur in process, in the context of the current project environment.
    • Method Detail

      • create

        public static MavenGoal create​(String pluginGroupId,
                                       String pluginArtifactId,
                                       String goalName,
                                       String executionId,
                                       MavenEnvironment environment)
                                throws Exception
        Returns a new instance.
        Parameters:
        pluginGroupId - The plugin group id.
        pluginArtifactId - The plugin artifact id.
        goalName - The plugin goal to execute.
        executionId - The execution id.
        environment - The plugin execution environment.
        Returns:
        The goal.
        Throws:
        Exception - if an error occurs.
      • incrementalBuild

        public void incrementalBuild​(BuildRoot.Changes changes,
                                     Consumer<String> stdOut,
                                     Consumer<String> stdErr)
                              throws Exception
        Description copied from interface: BuildStep
        Execute the build step for the given changed files only. Any component that does not match this predicate is ignored.
        Specified by:
        incrementalBuild in interface BuildStep
        Parameters:
        changes - The changes.
        stdOut - A consumer for stdout.
        stdErr - A consumer for stderr.
        Throws:
        Exception - on error.
      • execute

        public void execute()
                     throws Exception
        Executes the goal.
        Throws:
        Exception - if an error occurs.
      • name

        public String name()
        Returns the plugin goal name.
        Specified by:
        name in interface BuildStep
        Returns:
        The goal name.
      • pluginKey

        public String pluginKey()
        Returns the plugin key.
        Returns:
        The key.
      • executionId

        public String executionId()
        Returns the plugin key.
        Returns:
        The key.