Class WsScaffoldInitMojo

java.lang.Object
network.ike.plugin.ws.WsScaffoldInitMojo
All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo

@Mojo(name="scaffold-init", projectRequired=false, aggregator=true) public class WsScaffoldInitMojo extends Object implements org.apache.maven.api.plugin.Mojo
Bootstrap a workspace: create it from scratch when there is no workspace.yaml, otherwise clone any declared-but-missing subprojects.

This goal subsumes the retired ws:create and ws:init goals (IKE-Network/ike-issues#393) into a single idempotent entry point that "does the right thing" regardless of the current state of the directory:

  • No workspace.yaml in CWD — bootstrap mode. Generates pom.xml, workspace.yaml, .gitignore, .mvn/maven.config, .mvn/jvm.config, README.adoc, and installs the Maven wrapper. Optionally initializes git. Required: -Dgroup=<groupId>.
  • workspace.yaml present — init mode. Walks every declared subproject and ensures it is cloned (or initialized in place from a Syncthing-synced working tree, or fetched + rebased if already a healthy clone). Generates workspace-level docs (GOALS.md, WS-REFERENCE.md, CLAUDE.md).
  • Both states satisfied — every declared subproject already a clean clone, every wrapper at the right version — the goal no-ops with a single "all good" line.

Unlike most ws:* goals this mojo implements Mojo directly rather than extending AbstractWorkspaceMojo, because the bootstrap branch must run before a manifest exists. The init branch reads workspace.yaml inline.

# Bootstrap a new workspace:
mkdir my-ws && cd my-ws
mvn ws:scaffold-init -Dname=my-ws -Dgroup=org.example

# Inside an existing workspace, clone any missing subprojects:
mvn ws:scaffold-init
See Also:
  • Constructor Details

    • WsScaffoldInitMojo

      public WsScaffoldInitMojo()
      Creates this goal instance.
  • Method Details

    • execute

      public void execute() throws org.apache.maven.api.plugin.MojoException
      Specified by:
      execute in interface org.apache.maven.api.plugin.Mojo
      Throws:
      org.apache.maven.api.plugin.MojoException