Class MavenBuildSupport

  • All Implemented Interfaces:

    
    public final class MavenBuildSupport
    
                        

    Maven build support tailored to the Browser4 multi-module repository.

    Wraps mvn -pl <module> -am <goals> -DskipTests behind 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.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      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.
      final String format(BuildResult result, Integer maxOutputChars) Format a BuildResult for the agent: diagnostics first (structured), then a short tail of raw output.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MavenBuildSupport

        MavenBuildSupport()
    • 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