Enum Class PreflightCondition

java.lang.Object
java.lang.Enum<PreflightCondition>
network.ike.plugin.ws.preflight.PreflightCondition
All Implemented Interfaces:
Serializable, Comparable<PreflightCondition>, Constable

public enum PreflightCondition extends Enum<PreflightCondition>
Closed vocabulary of preflight checks that ws:* goals can require before they mutate workspace state. Each entry declares a human-readable description and a check(PreflightContext) implementation that returns Optional.empty() on success or a remediation message on failure.

Drafts and publishes invoke the same PreflightCondition sequence via Preflight; whether failure is a warning (draft) or a hard error (publish) is decided at the call site via PreflightResult.requirePassed(WsGoal) vs PreflightResult.warnIfFailed(Log, WsGoal).

New conditions are added here as goals adopt the contract from issue #154. Each new entry must stay self-contained: it does not depend on the mojo instance, only on the shared PreflightContext.

  • Enum Constant Details

    • WORKING_TREE_CLEAN

      public static final PreflightCondition WORKING_TREE_CLEAN
      Every subproject working tree (and the workspace root itself, if it is a git repo) must have no uncommitted changes. Any draft or publish goal that creates branches, edits POMs, or otherwise mutates files requires this.
    • NO_SNAPSHOT_PROPERTIES

      public static final PreflightCondition NO_SNAPSHOT_PROPERTIES
      No <properties> entry in any subproject root POM may hold a value ending in -SNAPSHOT. Maven 4's consumer POM flattener resolves properties and promotes <pluginManagement> into <plugins> when writing the released artifact — a SNAPSHOT property value would then be baked in as a literal and break downstream consumers (e.g. <ike-tooling.version>112-SNAPSHOT leaking into released ike-parent-105.pom). This check forces the release operator to bump the property to a released version before cutting the release.
    • JVM_CONFIG_NO_HASH_COMMENTS

      public static final PreflightCondition JVM_CONFIG_NO_HASH_COMMENTS
      No .mvn/jvm.config file in the workspace root or any subproject may contain a line starting with #.

      Maven parses .mvn/jvm.config as raw JVM arguments — one token per line, with no comment syntax. A # at column 0 is passed to the JVM launcher as a main-class name and IntelliJ surfaces it as Error: Could not find or load main class #. The fix is to delete the offending line; comments belong in .mvn/jvm.config.notes or similar adjacent files.

      This is the gate referenced in ike-issues#217. The check fires before the bad file can propagate to git or Syncthing — Maven's own validate phase can't catch this in the project that contains the bad file because the JVM dies before plugin code runs.

    • SUBPROJECT_HAS_DISTRIBUTION_MANAGEMENT

      public static final PreflightCondition SUBPROJECT_HAS_DISTRIBUTION_MANAGEMENT
      Every workspace subproject's root POM must either declare <distributionManagement> locally or have a <parent> block to inherit from (#346, surfaced by #343 when its/ was missing both).

      Site goals — specifically site:stage, which the workspace release cascade runs — fail with "Missing distribution management in project ..." when neither is present. That failure surfaces deep inside the release flow, after some subprojects have already tagged. This preflight catches the missing declaration upfront so the release-draft is authoritative.

    • NO_FOUNDATION_PROPERTY_SHADOWING

      public static final PreflightCondition NO_FOUNDATION_PROPERTY_SHADOWING
      No subproject's <properties> block may declare a locally-overriding value for any IKE-foundation property name (#346, surfaced by the its/ pom property-shadowing in the v150 cascade).

      Foundation properties ( ike-tooling.version, ike-docs.version, ike-platform.version) are set by ike-parent's inheritance chain. Local overrides silently shadow the workspace's intended versions and pin plugins to old releases that may lack newer goals. Preferred discipline: namespace local overrides under it.*, local.*, or a project-specific prefix that doesn't collide with the foundation set.

    • NO_ON_DISK_GHPAGES_LEAK

      public static final PreflightCondition NO_ON_DISK_GHPAGES_LEAK
      No on-disk gh-pages-style site output leaks at <projectDir>/<artifactId>/<artifactId>/index.html — whether or not git tracks them.

      Why this exists despite WORKING_TREE_CLEAN already detecting committed leaks: once an operator adds .gitignore entries (the standing workaround in ike-issues#358), the leak files are no longer reported by git status, so WORKING_TREE_CLEAN thinks the tree is clean — but the files keep getting regenerated under the working tree on every release flow. This check scans the filesystem directly so the operator sees the leak even when git has been told to ignore it.

      Pattern: a directory named exactly the same as a known cascade artifactId living inside another directory named the same, containing an index.html — signature of an mvn site render that escaped target/. We check both the workspace root (where workspace-root and subproject artifactIds can both shadow) and each subproject root. ike-issues#358.

    • NO_SCPEXE_SITE_URLS

      public static final PreflightCondition NO_SCPEXE_SITE_URLS
      No subproject root POM (nor the workspace root) declares a <distributionManagement><site><url> starting with scpexe:// — that wagon was retired in ike-issues#304 in favor of the GitHub Pages publish path (https://ike.network/<repo>/ via the org CNAME).

      A surviving scpexe:// is a silent release-blocker: the goal that consumes the URL only fails at the step that tries to use the wagon, after subproject releases have already started. This check catches it at draft time so the operator fixes the URL before any tags ship.

      ike-issues#372.

    • PARENT_COHERENCE

      public static final PreflightCondition PARENT_COHERENCE
  • Field Details

    • WORKSPACE_ROOT_NAME

      public static final String WORKSPACE_ROOT_NAME
      Special marker used when the workspace root itself has uncommitted changes.
      See Also:
  • Method Details

    • values

      public static PreflightCondition[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PreflightCondition valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • description

      public String description()
      Short human description of what this condition enforces.
    • check

      public abstract Optional<String> check(PreflightContext ctx)
      Evaluate the condition against the given context.
      Parameters:
      ctx - the preflight context
      Returns:
      Optional.empty() if the condition is satisfied; a remediation message otherwise