Record Class ReleaseContext
- Record Components:
gitRoot- the resolved git root for the project under releasemvnw- the resolvedmvnwwrapper script;nulluntil refined post-ReleasePrep viawithMvnw(File)log- the Maven plugin loggerrequest- the user-supplied release inputs
Bundles the resolved git root, Maven wrapper path, logger, and
the ReleaseRequest (user-supplied inputs). Threaded through
every release helper as a single parameter instead of positional
gitRoot/mvnw arguments, so that downstream phase
objects (FinalizePhase, NexusPhase, CentralPhase, ...) can be
extracted with stable method signatures.
Two-stage construction: the context is built early in
runGoal() with mvnw as null so that
ReleasePrep (which doesn't need mvnw) can run
against it. After mvnw is resolved, the mojo refines the
context via withMvnw(File) before any phase that does
need the Maven wrapper runs (logAudit, LocalPhase, NexusPhase,
CentralPhase, ...). Phases that don't need mvnw must not
dereference it; those that do are guaranteed to run only after
refinement.
Carved out of ReleaseDraftMojo during the Phase 4 P2
prep commit (IKE-Network/ike-issues#489). Mutable per-invocation
state (deploy attempt counts, async-spawn paths, etc.) lives on
the NexusOutcome / CentralOutcome records on the
mojo for now; a dedicated ReleaseRunState holder is
introduced when the orchestrator lands.
-
Constructor Summary
ConstructorsConstructorDescriptionReleaseContext(File gitRoot, File mvnw, org.apache.maven.api.plugin.Log log, ReleaseRequest request) Creates an instance of aReleaseContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.gitRoot()Returns the value of thegitRootrecord component.final inthashCode()Returns a hash code value for this object.org.apache.maven.api.plugin.Loglog()Returns the value of thelogrecord component.mvnw()Returns the value of themvnwrecord component.request()Returns the value of therequestrecord component.final StringtoString()Returns a string representation of this record class.Returns a copy of this context withmvnwreplaced.
-
Constructor Details
-
ReleaseContext
public ReleaseContext(File gitRoot, File mvnw, org.apache.maven.api.plugin.Log log, ReleaseRequest request) Creates an instance of aReleaseContextrecord class.
-
-
Method Details
-
withMvnw
Returns a copy of this context withmvnwreplaced.Used to refine the early-built (
mvnw == null) context once the wrapper is resolved.- Parameters:
mvnw- the resolved Maven wrapper script- Returns:
- a new
ReleaseContextwith the samegitRoot,log, andrequest, and the givenmvnw
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
gitRoot
-
mvnw
-
log
-
request
-