Class KnowledgeBindingsMojo

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

@Mojo(name="knowledge-bindings", defaultPhase="generate-sources") public class KnowledgeBindingsMojo extends Object implements org.apache.maven.api.plugin.Mojo
Generates the bindings class for a ledger-form knowledge set — the TinkarTerm idiom: one EntityProxy constant per declaration with its identity embedded as a resolved UUID literal and its javadoc generated from the declaration's definition — into target/generated-sources/ike-knowledge, registered as a compile source root so it compiles the Maven way and autocompletes in any IDE that includes the bindings artifact.

The generator itself lives tinkar-side ( dev.ikm.tinkar.entity.builder.BindingsMain) because this plugin stays tinkar-free (the foundation boundary). This goal builds a classloader over the project's MAIN_RUNTIME dependency classpath and invokes that one stable entry point reflectively, in-process. The project's ledger dependency provides a KnowledgeSetSource via META-INF/services; composition is store-free, so no datastore or providers are needed on the classpath.

Typical use — a *-bindings module depending on its *-terms ledger module:

<plugin>
    <groupId>network.ike.tooling</groupId>
    <artifactId>ike-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals><goal>knowledge-bindings</goal></goals>
            <configuration>
                <packageName>network.ike.richsurface.bindings</packageName>
                <className>RichSurfaceTerms</className>
            </configuration>
        </execution>
    </executions>
</plugin>
Since:
234
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates this goal instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Resolves the project's runtime dependency classpath, invokes the tinkar-side generator in a classloader over it, and registers the generated-sources root.
    protected org.apache.maven.api.plugin.Log
    Access the Maven logger.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KnowledgeBindingsMojo

      public KnowledgeBindingsMojo()
      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 project's runtime dependency classpath, invokes the tinkar-side generator in a classloader over it, and registers the generated-sources root.
      Specified by:
      execute in interface org.apache.maven.api.plugin.Mojo
      Throws:
      org.apache.maven.api.plugin.MojoException - if the classpath cannot be resolved, the generator entry point is absent (the ledger dependency chain does not include tinkar entity), or generation fails