Class CentralDeploySentinel
java.lang.Object
network.ike.plugin.CentralDeploySentinel
Status record for an asynchronous Maven Central deploy
(IKE-Network/ike-issues#484). Persisted as a Java
.properties file under a discoverable cache directory so the
outcome survives the originating Maven JVM exiting.
State machine (single forward transition): CentralDeploySentinel.State.PENDING
is written by the release Mojo when it spawns the detached
subprocess; the subprocess itself rewrites the file to
CentralDeploySentinel.State.SUCCESS or CentralDeploySentinel.State.FAILURE when it finishes.
Default location: ~/.cache/ike-release/. Chosen over
target/ so the sentinel survives a mvn clean and
is discoverable across repos by CentralStatusMojo, which
walks the directory to report in-flight deploys workspace-wide.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFluent builder forCentralDeploySentinel.static enumSentinel lifecycle states. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PathDefault sentinel directory:~/.cache/ike-release/. -
Method Summary
Modifier and TypeMethodDescriptionProject artifactId the deploy belongs to.intattempts()Number of attempts taken — refreshed by the subprocess before each upload soike:central-statusreflects live progress.builder()Start a new, empty builder.finished()When the deploy reached a terminal state, ornullwhile stillCentralDeploySentinel.State.PENDING.Short failure summary captured by the subprocess when the retry budget is exhausted.static List<CentralDeploySentinel> List all sentinel files under a directory, newest first.logFile()Path the subprocess streams its deploy log to.intConfigured maximum attempts for the retry loop, recorded so the displayedattempts/maxratio is meaningful even after the configuration changes between releases.note()Advisory note recorded alongside a non-failure outcome — e.g. a SUCCESS where JReleaser's publish poll timed out, so the upload is confirmed but PUBLISHED was never observed.path()Absolute path to this sentinel file on disk.longpid()PID of the spawned subprocess.static CentralDeploySentinelRead a sentinel file into a value object.static PathresolvePath(Path dir, String artifactId, String version) Resolve the canonical sentinel-file path for a project.started()When the deploy was spawned (UTC).state()Lifecycle state of this sentinel.Start a builder pre-seeded with this sentinel's fields — the typical entry point for the subprocess transitioningCentralDeploySentinel.State.PENDINGtoCentralDeploySentinel.State.SUCCESSorCentralDeploySentinel.State.FAILUREwithout restating immutable fields.version()Release version being deployed.voidwrite()Write this sentinel topath().
-
Field Details
-
DEFAULT_DIR
Default sentinel directory:~/.cache/ike-release/.
-
-
Method Details
-
state
-
artifactId
-
version
-
started
-
finished
When the deploy reached a terminal state, ornullwhile stillCentralDeploySentinel.State.PENDING.- Returns:
- the finish instant, or
nullwhen pending
-
attempts
public int attempts()Number of attempts taken — refreshed by the subprocess before each upload soike:central-statusreflects live progress.- Returns:
- attempts taken so far
-
maxAttempts
public int maxAttempts()Configured maximum attempts for the retry loop, recorded so the displayedattempts/maxratio is meaningful even after the configuration changes between releases.- Returns:
- the configured maximum
-
lastError
Short failure summary captured by the subprocess when the retry budget is exhausted.- Returns:
- failure summary, or
nullwhen not failed
-
logFile
Path the subprocess streams its deploy log to.- Returns:
- the log-file path, or
nullif not recorded
-
pid
public long pid()PID of the spawned subprocess. Written whileCentralDeploySentinel.State.PENDINGsoike:central-statuscan detect orphaned sentinels (subprocess died, sentinel never advanced).- Returns:
- the PID, or 0 if not recorded
-
note
Advisory note recorded alongside a non-failure outcome — e.g. a SUCCESS where JReleaser's publish poll timed out, so the upload is confirmed but PUBLISHED was never observed. Distinct fromlastError(), which is set only on FAILURE.- Returns:
- the note, or
nullif none was recorded
-
path
-
resolvePath
Resolve the canonical sentinel-file path for a project.- Parameters:
dir- sentinel directory (typicallyDEFAULT_DIR)artifactId- project artifactIdversion- release version- Returns:
<dir>/<artifactId>-<version>.properties
-
read
Read a sentinel file into a value object.- Parameters:
path- the sentinel file- Returns:
- the parsed sentinel
- Throws:
org.apache.maven.api.plugin.MojoException- if the file is missing or malformed
-
listAll
List all sentinel files under a directory, newest first. Files that fail to parse are skipped — listing must be robust against partially-written files an in-flight subprocess is updating.- Parameters:
dir- the sentinel directory (may not exist; treated as empty)- Returns:
- parsed sentinels, ordered by
starteddescending
-
write
public void write()Write this sentinel topath(). Atomic replace via a temp-file + rename so concurrent readers never see a half-written file.- Throws:
org.apache.maven.api.plugin.MojoException- on I/O failure
-
builder
Start a new, empty builder.- Returns:
- a fresh builder
-
toBuilder
Start a builder pre-seeded with this sentinel's fields — the typical entry point for the subprocess transitioningCentralDeploySentinel.State.PENDINGtoCentralDeploySentinel.State.SUCCESSorCentralDeploySentinel.State.FAILUREwithout restating immutable fields.- Returns:
- a builder seeded from this sentinel
-