Class KnowledgeAttachMojo

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

@Mojo(name="knowledge-attach", defaultPhase="verify") public class KnowledgeAttachMojo extends Object implements org.apache.maven.api.plugin.Mojo
Attaches produced knowledge artifacts to another reactor project — typically the aggregator — so a knowledge set's released coordinate carries the set's own name even though a subproject produced the files (IKE-Network/ike-issues#933). An aggregator builds before its subprojects and cannot run the exports itself; this goal runs in the producing subproject (after ike:knowledge-export and ike:kb-assemble) and attaches each file under the target project's GAV, so the released coordinate reads, for example, network.ike.foundation:ike-starter-set:<v>:reasoned-pb.

Pair with deployAtEnd/installAtEnd. The target project's own install/deploy executions run at its reactor position — before this goal attaches — so the consuming reactor must configure maven-install-plugin installAtEnd=true and maven-deploy-plugin deployAtEnd=true; both defer publication to session end, where the late attachments are included. Without that pairing the attachments never publish — this goal cannot detect the misconfiguration, so it is stated loudly here and in the consuming POM.

  • Constructor Details

    • KnowledgeAttachMojo

      public KnowledgeAttachMojo()
      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()
      Resolves the target reactor project and attaches each declared file under its GAV.
      Specified by:
      execute in interface org.apache.maven.api.plugin.Mojo
      Throws:
      org.apache.maven.api.plugin.MojoException - if the target project is not in the reactor, an attachment entry is malformed, or a declared file does not exist