Class GWPerModuleMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.machanism.machai.gw.maven.AbstractGWMojo
org.machanism.machai.gw.maven.GWPerModuleMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="gw-per-module", aggregator=false, threadSafe=true, requiresProject=true, requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class GWPerModuleMojo extends AbstractGWMojo
Maven goal that processes documents for the current Maven module.

Unlike an aggregator goal, this mojo runs once per module in the active Maven reactor. Maven determines module execution order using the standard reactor dependency graph, so submodules are processed according to their dependencies.

The goal reuses the shared scanning and GenAI configuration implemented by AbstractGWMojo. It initializes a GuidanceProcessor rooted at the reactor execution directory while binding Maven-specific project layout metadata for each processed module.

Parameters

This goal does not declare additional parameters. It uses the inherited parameters from AbstractGWMojo.

Inherited parameters

  • gw.model (model) - Provider/model identifier passed to the workflow.
  • ${basedir} (basedir) - Maven module base directory used as the default module location.
  • gw.path (path) - Optional scan root override. If not provided, the goal scans the current module base directory.
  • gw.instructions / <instructions> (instructions) - Instruction locations consumed by the workflow.
  • gw.excludes / <excludes> (excludes) - Exclude patterns or path skipped during scanning.
  • ${project} (project) - The current Maven project injected by Maven.
  • ${session} (session) - The current Maven session.
  • ${settings} (settings) - Maven settings used to resolve credentials from settings.xml.
  • genai.serverId (serverId) - Maven server id used to resolve GenAI credentials.
  • logInputs (logInputs) - Whether to log the list of workflow input files. Default: false.
  • ${reactorProjects} (reactorProjects) - Reactor projects available in the current Maven session.

Usage examples

Process each module in the current reactor build

 mvn gw:gw-per-module
 

Restrict scanning to a module documentation directory

 mvn gw:gw-per-module -Dgw.path=src/site
 

Use instructions and excludes while processing reactor modules

 mvn gw:gw-per-module \
   -Dgw.instructions=src/site/guidance.md \
   -Dgw.excludes=target,node_modules
 

Resolve GenAI credentials from Maven settings

 mvn gw:gw-per-module -Dgenai.serverId=my-model-server
 

Plugin configuration

 <plugin>
   <groupId>org.machanism</groupId>
   <artifactId>gw-maven-plugin</artifactId>
   <version>...</version>
   <configuration>
     <model>openai:gpt-4.1</model>
     <path>${project.basedir}/src/site</path>
     <instructions>src/site/guidance.md</instructions>
     <logInputs>true</logInputs>
   </configuration>
 </plugin>
 
  • Constructor Details

    • GWPerModuleMojo

      public GWPerModuleMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException