Class ActMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.machanism.machai.gw.maven.AbstractGWMojo
org.machanism.machai.gw.maven.ActMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ActPerModuleMojo

@Mojo(name="act", aggregator=true, threadSafe=true, requiresProject=false, requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class ActMojo extends AbstractGWMojo
Maven goal gw:act that runs an interactive, predefined "action" over a documentation tree.

An action is a prompt (typically sourced from a resource bundle or prompt file) that is applied to scanned documents. If -Dgw.act is not provided, the goal prompts the user interactively via Maven's Prompter component.

Parameters

-Dgw.act / <act>
Action text/prompt to apply. If omitted, the goal reads it interactively.
-Dgw.acts / <acts>
Optional directory containing predefined action definitions.

Inherited parameters (from AbstractGWMojo)

This goal also supports all common parameters defined by AbstractGWMojo (for example -Dgw.model, -Dgw.scanDir, -Dgw.excludes, -Dgenai.serverId, and -DlogInputs).

Usage examples

 mvn gw:act
 
 mvn gw:act -Dgw.act="Rewrite headings for clarity" -Dgw.scanDir=src\\site
 
 mvn gw:act -Dgw.acts=src\\site\\acts -DlogInputs=true
 
  • Field Details

    • prompter

      @Component protected org.codehaus.plexus.components.interactivity.Prompter prompter
      Interactive prompt provider used to collect action input.
    • actPrompt

      @Parameter(property="gw.act", required=false) protected String actPrompt
      Action prompt text. If not set, the goal prompts the user interactively.
  • Constructor Details

    • ActMojo

      public ActMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Executes the interactive action and scans documents using the configured action prompt.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if an I/O failure occurs while processing files
    • process

      protected void process(ActProcessor actProcessor) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • configureAndScan

      public void configureAndScan(ActProcessor actProcessor) throws org.apache.maven.plugin.MojoExecutionException, IOException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      IOException
    • applyActPrompt

      protected void applyActPrompt(Configurator conf) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • scanDocuments

      protected void scanDocuments(ActProcessor actProcessor) throws IOException
      Throws:
      IOException
    • readText

      public String readText(String prompt) throws org.codehaus.plexus.components.interactivity.PrompterException
      Reads multi-line input from the interactive Prompter.

      The user can enter multiple lines by ending a line with Ghostwriter.MULTIPLE_LINES_BREAKER. Input collection stops when a line does not end with the breaker.

      Parameters:
      prompt - the initial prompt label displayed to the user
      Returns:
      the collected text
      Throws:
      org.codehaus.plexus.components.interactivity.PrompterException - if prompting fails