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
FieldsModifier and TypeFieldDescriptionprotected FileThe Maven module base directory.protected StringInstruction locations consumed by the workflow.(package private) static final org.slf4j.Loggerprotected StringProvider/model identifier to pass to the workflow.(package private) StringOptional scan root override.protected org.apache.maven.project.MavenProjectThe current Maven project.protected List<org.apache.maven.project.MavenProject> Reactor projects available in the current Maven session.private StringMavenserverid used to resolve GenAI credentials.protected org.apache.maven.execution.MavenSessionThe current Maven session.private org.apache.maven.settings.SettingsMaven settings used to resolve credentials fromsettings.xml.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureAndScan(ActProcessor actProcessor) Configures and executes the document scanning workflow.voidexecute()Executes the interactive action and scans documents using the configured action prompt.protected org.machanism.macha.core.commons.configurator.PropertiesConfiguratorBuilds the processor configuration.protected voidprocess(ActProcessor actProcessor) Processes the document scanning workflow using the provided processor.protected voidscanDocuments(ActProcessor actProcessor) Scans documents in the specified project context using the configured processor.private voidupdateMavenProjectLayout(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
-
Field Details
-
logger
static final org.slf4j.Logger logger -
model
Provider/model identifier to pass to the workflow. -
basedir
The Maven module base directory. -
path
Optional scan root override. -
instructions
Instruction locations consumed by the workflow. -
project
@Parameter(readonly=true, defaultValue="${project}") protected org.apache.maven.project.MavenProject projectThe current Maven project. -
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession sessionThe current Maven session. -
settings
@Parameter(readonly=true, defaultValue="${settings}") private org.apache.maven.settings.Settings settingsMaven settings used to resolve credentials fromsettings.xml. -
serverId
Mavenserverid used to resolve GenAI credentials. -
reactorProjects
@Parameter(defaultValue="${reactorProjects}", readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjectsReactor projects available in the current Maven session.
-
-
Constructor Details
-
BindexMojo
public BindexMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionExecutes 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 updatemodel- 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 failsIOException- if an I/O error occurs
-
scanDocuments
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.MojoExecutionExceptionBuilds the processor configuration.If a Maven server id is configured, this method reads the matching server entry from
settings.xmland 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
-