Class BindexMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.machanism.machai.bindex.maven.BindexMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
BindexPerModuleMojo

@Mojo(name="bindex", aggregator=true, threadSafe=true, requiresProject=false, requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class BindexMojo extends org.apache.maven.plugin.AbstractMojo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected File
    The Maven module base directory.
    protected String
    Instruction locations consumed by the workflow.
    (package private) static final org.slf4j.Logger
     
    protected String
    Provider/model identifier to pass to the workflow.
    (package private) String
    Optional scan root override.
    protected org.apache.maven.project.MavenProject
    The current Maven project.
    protected List<org.apache.maven.project.MavenProject>
    Reactor projects available in the current Maven session.
    private String
    Maven server id used to resolve GenAI credentials.
    protected org.apache.maven.execution.MavenSession
    The current Maven session.
    private org.apache.maven.settings.Settings
    Maven settings used to resolve credentials from settings.xml.

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

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Configures and executes the document scanning workflow.
    void
    Executes the interactive action and scans documents using the configured action prompt.
    protected org.machanism.macha.core.commons.configurator.PropertiesConfigurator
    Builds the processor configuration.
    protected void
    process(ActProcessor actProcessor)
    Processes the document scanning workflow using the provided processor.
    protected void
    Scans documents in the specified project context using the configured processor.
    private void
    updateMavenProjectLayout(org.machanism.machai.project.layout.MavenProjectLayout mavenProjectLayout, org.apache.maven.model.Model model)
    Updates the Maven project layout with the appropriate model configuration.

    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
  • Field Details

    • logger

      static final org.slf4j.Logger logger
    • model

      @Parameter(property="gw.model") protected String model
      Provider/model identifier to pass to the workflow.
    • basedir

      @Parameter(defaultValue="${basedir}", required=true) protected File basedir
      The Maven module base directory.
    • path

      @Parameter(property="gw.path") String path
      Optional scan root override.
    • instructions

      @Parameter(property="gw.instructions", name="instructions") protected String instructions
      Instruction locations consumed by the workflow.
    • project

      @Parameter(readonly=true, defaultValue="${project}") protected org.apache.maven.project.MavenProject project
      The current Maven project.
    • session

      @Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession session
      The current Maven session.
    • settings

      @Parameter(readonly=true, defaultValue="${settings}") private org.apache.maven.settings.Settings settings
      Maven settings used to resolve credentials from settings.xml.
    • serverId

      @Parameter(property="genai.serverId", required=false) private String serverId
      Maven server id used to resolve GenAI credentials.
    • reactorProjects

      @Parameter(defaultValue="${reactorProjects}", readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjects
      Reactor projects available in the current Maven session.
  • Constructor Details

    • BindexMojo

      public BindexMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Executes the interactive action and scans documents using the configured action prompt.

      This method initializes usage statistics, configures the processor, and executes the document scanning workflow. It supports interactive mode, parallel execution, and non-recursive processing based on the current Maven session and configuration.

      Throws:
      org.apache.maven.plugin.MojoExecutionException - if an I/O failure occurs while processing files
    • updateMavenProjectLayout

      private void updateMavenProjectLayout(org.machanism.machai.project.layout.MavenProjectLayout mavenProjectLayout, org.apache.maven.model.Model model)
      Updates the Maven project layout with the appropriate model configuration.
      Parameters:
      mavenProjectLayout - the Maven project layout to update
      model - the Maven model containing project metadata
    • process

      protected void process(ActProcessor actProcessor) throws org.apache.maven.plugin.MojoExecutionException
      Processes the document scanning workflow using the provided processor.
      Parameters:
      actProcessor - the processor configured for scanning and processing documents
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if an error occurs during processing
    • configureAndScan

      public void configureAndScan(ActProcessor actProcessor) throws org.apache.maven.plugin.MojoExecutionException, IOException
      Configures and executes the document scanning workflow.
      Parameters:
      actProcessor - the processor configured for scanning and processing documents
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if scanning or processing fails
      IOException - if an I/O error occurs
    • scanDocuments

      protected void scanDocuments(ActProcessor actProcessor) throws IOException
      Scans documents in the specified project context using the configured processor.
      Parameters:
      actProcessor - the processor configured for scanning and processing documents
      Throws:
      IOException - if an I/O error occurs during scanning
    • getConfiguration

      protected org.machanism.macha.core.commons.configurator.PropertiesConfigurator getConfiguration() throws org.apache.maven.plugin.MojoExecutionException
      Builds the processor configuration.

      If a Maven server id is configured, this method reads the matching server entry from settings.xml and copies its username, password, and any custom XML configuration values into the returned configurator.

      Returns:
      configuration for downstream workflow execution
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if Maven settings are unavailable or the configured server cannot be found