Class AbstractKeyBasedMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
au.net.causal.maven.plugins.jgitcrypt.AbstractKeyBasedMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractDecryptFileMojo, AbstractEncryptFileMojo, DecryptFilesMojo, EncryptFilesMojo

public abstract class AbstractKeyBasedMojo extends org.apache.maven.plugin.AbstractMojo
Abstract mojo that uses a git-crypt key. The key may be sourced from either a base-64 encoded property value, a base64-encoded value read from a server password in the user's settings, a private key file defined in a server in the user's settings, or a key file specified by property. Only one of these three settings should be defined.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.maven.execution.MavenSession
     
    protected org.apache.maven.project.MavenProject
     

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
    protected GitcryptKey
    Loads the git-crypt key using one of the key properties.

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.maven.plugin.Mojo

    execute
  • Field Details

    • mavenSession

      @Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession mavenSession
    • project

      @Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject project
  • Constructor Details

    • AbstractKeyBasedMojo

      public AbstractKeyBasedMojo()
  • Method Details

    • getGitcryptKeyLocationDescription

      protected String getGitcryptKeyLocationDescription()
      Returns:
      a textual description of the key location, used for log messages.
    • loadGitcryptKey

      protected GitcryptKey loadGitcryptKey() throws org.apache.maven.plugin.MojoExecutionException
      Loads the git-crypt key using one of the key properties.
      Returns:
      the loaded git-crypt key.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if an error occurs loading the key, or no key is found or defined.