Class LintSiteMojo

java.lang.Object
network.ike.docs.plugin.LintSiteMojo
All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo

@Mojo(name="lint-site", defaultPhase="validate") public class LintSiteMojo extends Object implements org.apache.maven.api.plugin.Mojo
Lint src/site/site.xml for IKE Network theme + breadcrumb conventions (ike-issues#319).

The shared site assets (site.css, ike-logo.svg) are consolidated in ike-doc-resources (#318). The per-project site.xml legitimately stays local — breadcrumbs and menus genuinely vary — but it carries a small set of conventions that have drifted in the past:

  • <bodyClass> must be sentry-green (Forest theme) for ike.network consumers, sentry-purple (Horizon) for knowledge.design. The 5 ike-docs submodules shipped with sentry-purple after ike-platform and ike-tooling switched to sentry-green (per #307), producing a purple banner at https://ike.network/ike-docs/ike-doc-resources/.
  • Breadcrumb leading item — those same 5 files carried a stale <item name="IKE Pipeline" href="../index.html"/> from before the ike-pipeline → ike-docs/ike-platform repo split (#216).
  • <skin> GAV — drift here is silent until you upgrade.

The ike.network ↔ knowledge.design boundary means a single global enforcement isn't right; the expected bodyClass is per-deployment. Set the deployment target via the ike.site.deployment property (defaults to ike-network).

When src/site/site.xml doesn't exist, this goal is a silent no-op — modules without a custom site descriptor inherit from the parent and don't need linting.

Skip with -Dike.skip.lint-site=true.

See Also:
  • Constructor Details

    • LintSiteMojo

      public LintSiteMojo()
      Creates this goal instance.
  • Method Details

    • getLog

      protected org.apache.maven.api.plugin.Log getLog()
      Access the Maven logger.
      Returns:
      the logger
    • execute

      public void execute() throws org.apache.maven.api.plugin.MojoException
      Specified by:
      execute in interface org.apache.maven.api.plugin.Mojo
      Throws:
      org.apache.maven.api.plugin.MojoException
    • lint

      public static List<String> lint(String siteXmlContent, String deployment, String expectedSkinGroup, String expectedSkinArtifact)
      Apply all site.xml lint rules to the given content. Pure function for testability — does no I/O.
      Parameters:
      siteXmlContent - raw site.xml as a string
      deployment - deployment target (ike-network or knowledge-design)
      expectedSkinGroup - expected <skin> groupId
      expectedSkinArtifact - expected <skin> artifactId
      Returns:
      list of problem messages; empty if all checks passed
    • expectedBodyClassFor

      public static String expectedBodyClassFor(String deployment)
      Return the expected <bodyClass> for a deployment target.
      Parameters:
      deployment - one of ike-network or knowledge-design
      Returns:
      the expected bodyClass string