Class WorkspaceBootstrap

java.lang.Object
network.ike.plugin.ws.bootstrap.WorkspaceBootstrap

public final class WorkspaceBootstrap extends Object
Generates the on-disk scaffold for a brand-new IKE workspace.

Subsumes the file-generation half of the retired WsCreateMojo (folded into ws:scaffold-init per IKE-Network/ike-issues#393): given a target directory and a small parameter bag, writes the standard workspace files (pom.xml, workspace.yaml, .gitignore, .mvn/maven.config, .mvn/jvm.config, README.adoc) and installs the Maven wrapper via MavenWrapper.writeMissingFiles(Path, String).

The generated files follow current IKE conventions:

  • POM uses Maven 4.1.0 model with root="true"
  • .gitignore uses whitelist strategy (ignore everything, whitelist workspace-owned files)
  • workspace.yaml has schema-version 1.1 with a typed workspace-root: block holding the workspace's GAV (ike-issues#183) and an empty subprojects: list
  • .mvn/maven.config sets -T 1C

This class is a pure scaffold writer — it does not consult workspace.yaml (none exists yet), does not iterate subprojects, and never extends AbstractWorkspaceMojo.

See Also:
  • Constructor Details

    • WorkspaceBootstrap

      public WorkspaceBootstrap(WorkspaceBootstrap.Params params, org.apache.maven.api.plugin.Log log)
      Create a workspace bootstrapper bound to a parameter bag and a logger. Construction is cheap; the actual filesystem writes happen in createAt(Path).
      Parameters:
      params - the resolved create-time parameters
      log - the mojo logger
  • Method Details

    • createAt

      public void createAt(Path wsDir) throws org.apache.maven.api.plugin.MojoException
      Write the full workspace scaffold into wsDir and optionally initialize git. The directory must not already contain pom.xml or workspace.yaml; the caller is responsible for that pre-check.
      Parameters:
      wsDir - the workspace directory to populate
      Throws:
      org.apache.maven.api.plugin.MojoException - on file or git failures