Class BindexPerModuleMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.machanism.machai.gw.maven.AbstractGWMojo
org.machanism.machai.gw.maven.AbstractActMojo
org.machanism.machai.gw.maven.AbstractActPerModuleMojo
org.machanism.machai.bindex.maven.BindexPerModuleMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
RegisterPerModuleMojo

@Mojo(name="bindex-per-module", aggregator=false, threadSafe=true, requiresProject=true, requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class BindexPerModuleMojo extends org.machanism.machai.gw.maven.AbstractActPerModuleMojo
Maven goal that generates Bindex metadata in the context of each module in a multi-module reactor.

Unlike BindexMojo, this non-aggregating goal is invoked separately for every Maven project to which it is bound. It delegates to the bindex Machai Act after the inherited per-module infrastructure has prepared the current project, reactor session, settings, and configured workflow parameters.

Use this goal when Bindex generation must be associated with individual module execution, for example through mvn bindex:bindex-per-module. Use BindexMojo instead when one reactor-wide invocation is desired.

Since:
1.0
  • Field Summary

    Fields inherited from class org.machanism.machai.gw.maven.AbstractActMojo

    act, prompter

    Fields inherited from class org.machanism.machai.gw.maven.AbstractGWMojo

    basedir, classFunctionTools, configFile, excludes, instructions, model, params, path, project, serverId, SERVERID_PROP_NAME, session, settings

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the per-module Bindex goal.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the Bindex workflow for the current Maven module.
    void
    setBasedir(File basedir)
    Sets the module base directory used to resolve workflow-relative paths.
    void
    setConfigFile(File configFile)
    Sets an optional workflow configuration file.
    void
    setExcludes(String[] excludes)
    Sets path patterns that the workflow must skip for the current module.
    void
    setInstructions(String instructions)
    Sets supplemental instructions passed to the Bindex workflow.
    void
    Selects the AI model used by the Bindex workflow.
    void
    Sets arbitrary parameters to forward unchanged to the Machai Act.
    void
    setProject(org.apache.maven.project.MavenProject project)
    Supplies the Maven project for the module currently being processed.
    void
    setServerId(String serverId)
    Selects the Maven server entry that supplies workflow credentials.
    void
    setSession(org.apache.maven.execution.MavenSession session)
    Supplies the active Maven session, including reactor execution context.
    void
    setSettings(org.apache.maven.settings.Settings settings)
    Supplies the effective Maven settings for this module execution.

    Methods inherited from class org.machanism.machai.gw.maven.AbstractActPerModuleMojo

    performAct, scanDocuments

    Methods inherited from class org.machanism.machai.gw.maven.AbstractActMojo

    applyActPrompt, configureAndScan, getPrompter, process, readText, setPrompter, updateMavenProjectLayout

    Methods inherited from class org.machanism.machai.gw.maven.AbstractGWMojo

    applyExcludes, getConfiguration, scanDocuments, setPath

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BindexPerModuleMojo

      public BindexPerModuleMojo()
      Creates the per-module Bindex goal.

      Maven instantiates the mojo reflectively and injects the annotated parameters before execution.

  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Executes the Bindex workflow for the current Maven module.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the workflow cannot be prepared or executed successfully
      org.apache.maven.plugin.MojoFailureException - if the workflow reports a build failure that is not an execution error
    • setSettings

      @Parameter(readonly=true, defaultValue="${settings}") public void setSettings(org.apache.maven.settings.Settings settings)
      Supplies the effective Maven settings for this module execution.
      Overrides:
      setSettings in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      settings - effective settings supplied by Maven; may be null when Maven does not provide settings
    • setSession

      @Parameter(defaultValue="${session}", readonly=true, required=true) public void setSession(org.apache.maven.execution.MavenSession session)
      Supplies the active Maven session, including reactor execution context.
      Overrides:
      setSession in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      session - active Maven session supplied by Maven; required for goal execution
    • setProject

      @Parameter(readonly=true, defaultValue="${project}") public void setProject(org.apache.maven.project.MavenProject project)
      Supplies the Maven project for the module currently being processed.
      Overrides:
      setProject in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      project - current Maven project; required because this goal executes per module
    • setBasedir

      @Parameter(defaultValue="${basedir}", required=true) public void setBasedir(File basedir)
      Sets the module base directory used to resolve workflow-relative paths.
      Overrides:
      setBasedir in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      basedir - base directory of the current Maven invocation; required for goal execution
    • setConfigFile

      @Parameter(property="gw.config", required=false) public void setConfigFile(File configFile)
      Sets an optional workflow configuration file.
      Overrides:
      setConfigFile in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      configFile - optional configuration file, or null to use the workflow's normal configuration resolution
    • setModel

      @Parameter(property="gw.model") public void setModel(String model)
      Selects the AI model used by the Bindex workflow.
      Overrides:
      setModel in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      model - model identifier, or null to use the workflow's configured default
    • setInstructions

      @Parameter(property="gw.instructions", name="instructions") public void setInstructions(String instructions)
      Sets supplemental instructions passed to the Bindex workflow.
      Overrides:
      setInstructions in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      instructions - additional workflow instructions, or null when none are configured
    • setExcludes

      @Parameter(property="gw.excludes", name="excludes") public void setExcludes(String[] excludes)
      Sets path patterns that the workflow must skip for the current module.
      Overrides:
      setExcludes in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      excludes - exclusion patterns, or null when no exclusions are configured
    • setServerId

      @Parameter(property="genai.serverId", required=false) public void setServerId(String serverId)
      Selects the Maven server entry that supplies workflow credentials.
      Overrides:
      setServerId in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      serverId - Maven settings.xml server identifier, or null when no server entry is selected explicitly
    • setParams

      @Parameter public void setParams(Map<String,String> params)
      Sets arbitrary parameters to forward unchanged to the Machai Act.
      Overrides:
      setParams in class org.machanism.machai.gw.maven.AbstractGWMojo
      Parameters:
      params - parameter names and values, or null when no extra parameters are configured