Class SubprojectInitializer
java.lang.Object
network.ike.plugin.ws.bootstrap.SubprojectInitializer
Walks the subprojects declared in
workspace.yaml and ensures
each one is cloned and initialized with the workspace-standard
configuration: post-checkout git hook, Maven wrapper at the declared
version, .mvn/jvm.config, and the per-subproject
CLAUDE.md / CLAUDE-<name>.md pair.
Subsumes the per-subproject half of the retired
InitWorkspaceMojo (folded into ws:scaffold-init per
IKE-Network/ike-issues#393). Three initialization modes per
subproject:
- Already cloned — directory has
.git/; fetch + rebase if clean, otherwise skip with a warning. - Syncthing working tree — directory exists but no
.git/. Initializes git in-place:git init, adds the remote, fetches, and resets to match the remote branch. This preserves file content synced from another machine. - Fresh clone — no directory; runs
git clone.
Subprojects are initialized in topological (dependency) order.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOutcome counters for one initialization pass. -
Constructor Summary
ConstructorsConstructorDescriptionSubprojectInitializer(network.ike.workspace.WorkspaceGraph graph, File root, String workspaceName, org.apache.maven.api.plugin.Log log) Bind an initializer to an already-loaded workspace. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenerateClaudeNotes(String name) Generate the starter template for hand-authored project notes.static StringgenerateComponentClaudeMd(network.ike.workspace.Subproject subproject) GenerateCLAUDE.mdfor a subproject directory.static StringGenerate the workspace goal cheatsheet (GOALS.md).static StringgenerateWorkspaceClaudeMd(String wsName, network.ike.workspace.WorkspaceGraph graph) GenerateCLAUDE.mdfor the workspace root.static StringGenerate the long-form workspace goal reference (WS-REFERENCE.md).run()Run the full per-subproject initialization pass and emit the workspace-level docs (GOALS.md,WS-REFERENCE.md,CLAUDE.md,CLAUDE-<name>.md).
-
Constructor Details
-
SubprojectInitializer
public SubprojectInitializer(network.ike.workspace.WorkspaceGraph graph, File root, String workspaceName, org.apache.maven.api.plugin.Log log) Bind an initializer to an already-loaded workspace.- Parameters:
graph- the loaded workspace graphroot- the workspace root directoryworkspaceName- workspace artifactId, used in the report headerlog- the mojo logger
-
-
Method Details
-
run
Run the full per-subproject initialization pass and emit the workspace-level docs (GOALS.md,WS-REFERENCE.md,CLAUDE.md,CLAUDE-<name>.md).- Returns:
- the per-subproject outcome counters
- Throws:
org.apache.maven.api.plugin.MojoException- if any clone/fetch step fails
-
generateWorkspaceClaudeMd
public static String generateWorkspaceClaudeMd(String wsName, network.ike.workspace.WorkspaceGraph graph) GenerateCLAUDE.mdfor the workspace root. Static so the generator can be unit-tested without instantiating the mojo.- Parameters:
wsName- the workspace namegraph- the loaded workspace graph (unused in the body but kept so future per-subproject summaries can be threaded through without an API break)- Returns:
- the markdown content
-
generateComponentClaudeMd
GenerateCLAUDE.mdfor a subproject directory. Static for testability.- Parameters:
subproject- the subproject definition- Returns:
- the markdown content
-
generateClaudeNotes
-
generateGoalCheatsheet
Generate the workspace goal cheatsheet (GOALS.md). Static so the content can be diffed independently of the mojo.- Returns:
- the markdown content
-
generateWorkspaceReference
Generate the long-form workspace goal reference (WS-REFERENCE.md). Static for testability.- Returns:
- the markdown content
-