Class MavenSettingsAdapter
java.lang.Object
network.ike.plugin.scaffold.MavenSettingsAdapter
- All Implemented Interfaces:
ModelAdapter
Model adapter for
~/.m2/settings.xml (Maven Settings 1.2.0).
Supported ensure subtree:
ensure:
pluginGroups:
- network.ike.tooling
Semantics:
- If the file does not exist, a minimal
<settings xmlns="...">document is created. - Each
pluginGroupinensure.pluginGroupsthat is not already present is appended. Existing entries — and any unrelated elements (servers, profiles, …) — are left untouched. - Each installed or re-confirmed
pluginGroupis recorded as aManagedElementwith path"/settings/pluginGroups/pluginGroup[text()='G']".
DOM-based so unmanaged content (comments, whitespace outside the managed region, unrelated child elements) is preserved on round-trip to the extent the Transformer supports it.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionModel name this adapter handles, matchingManifestEntry.model()(e.g.plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, LockfileEntry priorEntry, String currentStandardsVersion) Plan a single model-managed entry.
-
Field Details
-
MODEL_NAME
-
-
Constructor Details
-
MavenSettingsAdapter
public MavenSettingsAdapter()Construct a stateless Maven-settings adapter. Instances are safe to share across planning calls; all per-invocation state lives on method parameters.
-
-
Method Details
-
modelName
Description copied from interface:ModelAdapterModel name this adapter handles, matchingManifestEntry.model()(e.g."maven-settings-4").- Specified by:
modelNamein interfaceModelAdapter- Returns:
- the model name; never
null
-
plan
public ModelPlanResult plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, LockfileEntry priorEntry, String currentStandardsVersion) Description copied from interface:ModelAdapterPlan a single model-managed entry.- Specified by:
planin interfaceModelAdapter- Parameters:
entry- the manifest entry; must haveScaffoldTier.MODEL_MANAGEDtier andmodel()equal toModelAdapter.modelName()resolvedDest- absolute destination path (placeholders already expanded)currentContent- bytes currently on disk atresolvedDest, ornullif no file existspriorEntry- lockfile entry from the last publish, ornullif never appliedcurrentStandardsVersion- thestandards-versionof the current manifest; stamped on newly-installed elements so drift can be reasoned about later- Returns:
- a
ModelPlanResultwith both aTierActionand the element-level provenance for the lockfile
-