Package ai.platon.pulsar.coding
Class MavenBuildSupport
-
- All Implemented Interfaces:
public final class MavenBuildSupportMaven build support tailored to the Browser4 multi-module repository.
Wraps
mvn -pl <module> -am <goals> -DskipTestsbehind the coding shell's command whitelist (mvn is a DEV command), returns a structured BuildResult, and parses Kotlin/Java compiler errors into BuildDiagnostics so the agent does not have to read raw Maven logs.This is the "compiler passthrough" half of the Kotlin diagnostics story — LSP servers for Kotlin (JDTLS) are heavy; for quick feedback, compiling the affected module and parsing the errors is cheap and dependency-free.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMavenBuildSupport.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static MavenBuildSupport.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description MavenBuildSupport()
-
Method Summary
Modifier and Type Method Description final BuildResultbuild(CodingAgentShell shell, String module, String goals, Boolean skipTests, Long timeoutSeconds, String workingDir)Run a Maven build for a module and return structured results. final Stringformat(BuildResult result, Integer maxOutputChars)Format a BuildResult for the agent: diagnostics first (structured), then a short tail of raw output. -
-
Method Detail
-
build
final BuildResult build(CodingAgentShell shell, String module, String goals, Boolean skipTests, Long timeoutSeconds, String workingDir)
Run a Maven build for a module and return structured results.
- Parameters:
shell- the coding shell (mvn must be allowed — it is a DEV command)module- module path, e.g.goals- space-separated goals, default "compile"skipTests- whether to add -DskipTests (default true — the agent should opt into tests explicitly, matching the repo's test policy)timeoutSeconds- max build time (default 300s; maven builds are slow)workingDir- repo root (or module dir); default null = shell base dir
-
format
final String format(BuildResult result, Integer maxOutputChars)
Format a BuildResult for the agent: diagnostics first (structured), then a short tail of raw output.
-
-
-
-