Class CopyDocsToSiteMojo

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

@Mojo(name="copy-docs", defaultPhase="site") public class CopyDocsToSiteMojo extends Object implements org.apache.maven.api.plugin.Mojo
Copy rendered HTML docs and assets into the Maven site output directory.

Copies HTML files plus supporting assets (SVG diagrams, PNG/JPG images, CSS stylesheets) from the Asciidoctor generated-docs directory into target/site/docs/ so they are deployed alongside the Maven site.

Replaces: copy-docs-to-site.sh

Usage:

mvn idoc:copy-docs -DgeneratedDocsDir=target/generated-docs/html -DsiteDir=target/site
  • Field Details

    • COPY_EXTENSIONS

      public static final List<String> COPY_EXTENSIONS
      File extensions to copy from generated-docs to the site.
  • Constructor Details

    • CopyDocsToSiteMojo

      public CopyDocsToSiteMojo()
      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
    • shouldCopy

      public static boolean shouldCopy(String filename)
      Check whether a filename has an extension in the copy list.
      Parameters:
      filename - the filename to check
      Returns:
      true if the file should be copied