Package org.machanism.machai.maven
Class Assembly
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.machanism.machai.maven.Assembly
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="assembly",
requiresProject=false,
requiresDependencyCollection=NONE)
public class Assembly
extends org.apache.maven.plugin.AbstractMojo
Mojo for assembling Maven projects using AI-powered library recommendations
and code generation.
This mojo provides an interactive prompt and automated selection of dependencies using a prompt and AI provider. It can recommend libraries and assemble the project structure based on user input or prompt files. See usage example below for typical invocation.
mvn org.machanism.machai.maven:assembly -Dassembly.inputs.only=false
Parameters
- assembly.inputs.only: Only input prompt (boolean)
- assembly.chatModel: Chat model for assembly (String)
- pick.chatModel: Chat model for library picking (String)
- assembly.prompt.file: Prompt file name (File)
- assembly.score: Score threshold for selection (Double)
- basedir: Project directory (File)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileFile containing the prompt for the assembly process.protected FileMaven project base directory.protected StringSpecifies the AI chat model to use for assembly-related tasks.protected booleanIndicates if only the prompt input should be processed and actual assembly should be skipped.protected StringSpecifies the AI chat model to use when recommending/picking libraries.protected org.codehaus.plexus.components.interactivity.PrompterPrompter instance for interactive command-line input.protected String"URL of the registration database for storing project metadata.protected DoubleScore threshold for recommended libraries; only libraries meeting the minimum score will be offered.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
prompter
@Component protected org.codehaus.plexus.components.interactivity.Prompter prompterPrompter instance for interactive command-line input. -
inputsOnly
@Parameter(property="assembly.inputs.only", defaultValue="false") protected boolean inputsOnlyIndicates if only the prompt input should be processed and actual assembly should be skipped. -
chatModel
Specifies the AI chat model to use for assembly-related tasks. -
pickChatModel
@Parameter(property="pick.chatModel", defaultValue="OpenAI:gpt-5-mini") protected String pickChatModelSpecifies the AI chat model to use when recommending/picking libraries. -
assemblyPromptFile
@Parameter(property="assembly.prompt.file", defaultValue="project.txt") protected File assemblyPromptFileFile containing the prompt for the assembly process. -
score
Score threshold for recommended libraries; only libraries meeting the minimum score will be offered. -
registerUrl
"URL of the registration database for storing project metadata. -
basedir
Maven project base directory.
-
-
Constructor Details
-
Assembly
public Assembly()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionExecutes the assembly process.Attempts to load a prompt from the file (if it exists), then uses the Picker to recommend libraries and applies the AI-powered system functions to generate or update project content. If inputsOnly is false, prompts the user in a loop for API interaction until they enter "exit".
Parameters
assemblyPromptFile- The prompt file for assemblyscore- Score threshold for selectionpickChatModel- Model used for library pickingchatModel- Model used for assembly tasksbasedir- Project directoryprompter- Interactive prompt command line toolinputsOnly- Process only prompt or assemble project
- Throws:
org.apache.maven.plugin.MojoExecutionException- if the assembly or prompt interaction fails- See Also:
-