Class AbstractGWMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
ActMojo,GWMojo,GWPerModuleMojo
This class centralizes shared configuration parameters and the common
scan/execute flow. Concrete goals typically configure goal-specific behavior
and delegate to scanDocuments(GuidanceProcessor).
It also resolves optional GenAI credentials from Maven settings.xml
and exposes them to the processing pipeline through a
PropertiesConfigurator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileThe Maven module base directory.protected ClassFunctionalToolsTool set exposed to the processor for class-related project introspection.protected String[]Exclude patterns or paths skipped during scanning.protected StringInstruction locations consumed by the workflow.(package private) static final org.slf4j.Loggerprotected booleanWhether to log the list of workflow input files.protected StringProvider/model identifier to pass to the workflow.protected org.apache.maven.project.MavenProjectThe current Maven project.protected List<org.apache.maven.project.MavenProject> Reactor projects available in the current Maven session.(package private) StringOptional scan root override.protected org.apache.maven.execution.MavenSessionThe current Maven session.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertiesConfiguratorBuilds the processor configuration.protected voidscanDocuments(GuidanceProcessor processor) Configures and executes document scanning for the current project context.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
logger
static final org.slf4j.Logger logger -
model
Provider/model identifier to pass to the workflow. -
basedir
The Maven module base directory. -
scanDir
Optional scan root override. -
instructions
Instruction locations consumed by the workflow. -
excludes
Exclude patterns or paths skipped during scanning. -
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. -
logInputs
@Parameter(property="logInputs", defaultValue="false") protected boolean logInputsWhether to log the list of workflow input files. -
reactorProjects
@Parameter(defaultValue="${reactorProjects}", readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjectsReactor projects available in the current Maven session. -
classFunctionTools
Tool set exposed to the processor for class-related project introspection.
-
-
Constructor Details
-
AbstractGWMojo
protected AbstractGWMojo()Creates the base mojo instance.
-
-
Method Details
-
getConfiguration
protected 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
-
scanDocuments
protected void scanDocuments(GuidanceProcessor processor) throws org.apache.maven.plugin.MojoExecutionException Configures and executes document scanning for the current project context.This method applies configured excludes, optional instructions, input logging, and scan directory selection before invoking
AIFileProcessor.scanDocuments(File, String). When a Maven project is present in the request, class-related helper tools are also registered with the processor.- Parameters:
processor- the processor to configure and execute- Throws:
org.apache.maven.plugin.MojoExecutionException- if scanning or processing fails
-