Class ActPerModuleMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="act-per-module", aggregator=false, threadSafe=true, requiresProject=true, requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class ActPerModuleMojo extends ActMojo
Maven goal gw:act-per-module that runs an action against the execution-root project using Maven's standard reactor build context.

Unlike ActMojo (which is an aggregator and can discover/scan modules itself), this goal executes as part of a standard reactor build. It typically targets the execution-root project only and delegates the scan to ActProcessor.

Parameters

This goal does not introduce additional parameters beyond those supported by ActMojo and AbstractGWMojo.

Inherited parameters (from ActMojo)

-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)

-Dgw.model / <model>
Provider/model identifier forwarded to the workflow. Example: openai:gpt-4o-mini.
-Dgw.path / <path>
Optional scan root override. When omitted, defaults to the execution-root directory.
-Dgw.excludes / <excludes>
Exclude patterns/path to skip while scanning documentation sources.
-Dgenai.serverId / <serverId>
settings.xml <server> id used to read GenAI credentials.

Usage examples

 mvn gw:act-per-module
 
 mvn gw:act-per-module -Dgw.act="Rewrite headings" -Dgw.path=src\\site
 
  • Constructor Details

    • ActPerModuleMojo

      public ActPerModuleMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Description copied from class: ActMojo
      Executes the configured act goal.

      The method creates and configures an ActProcessor, resolves Maven and Ghostwriter configuration values, applies inherited parameters such as path, model, instructions, excludes, and interactive mode, and then scans the selected documents. A zero-code ProcessTerminationException is treated as normal termination.

      Specified by:
      execute in interface org.apache.maven.plugin.Mojo
      Overrides:
      execute in class ActMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if configuration, prompting, or file processing fails
    • scanDocuments

      protected void scanDocuments(ActProcessor actProcessor) throws IOException
      Description copied from class: ActMojo
      Scans the resolved project path with the configured act processor.
      Overrides:
      scanDocuments in class ActMojo
      Parameters:
      actProcessor - the processor used to scan documents
      Throws:
      IOException - if reading or writing project files fails