Class LicenseCheckMojo

java.lang.Object
nl.javadude.gradle.plugins.license.maven.LicenseCheckMojo
All Implemented Interfaces:
com.mycila.maven.plugin.license.Callback, CallbackWithFailure

public final class LicenseCheckMojo extends Object implements CallbackWithFailure
CallbackWithFailure implementation for check mode: logs files with missing headers and collects them as violations. Does not modify any files.

Inlined from hierynomus/license-gradle-plugin.

Since:
1.1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LicenseCheckMojo(File basedir, boolean skipExistingHeaders)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns all files that were affected (missing header or reformatted, depending on the concrete implementation).
    boolean
    Returns true if at least one file triggered a header violation during processing.
    void
    onExistingHeader(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header)
     
    void
    onHeaderNotFound(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header)
     
    void
    onUnknownFile(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header)
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • LicenseCheckMojo

      public LicenseCheckMojo(File basedir, boolean skipExistingHeaders)
  • Method Details

    • onHeaderNotFound

      public void onHeaderNotFound(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header)
      Specified by:
      onHeaderNotFound in interface com.mycila.maven.plugin.license.Callback
    • onUnknownFile

      public void onUnknownFile(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header)
      Specified by:
      onUnknownFile in interface com.mycila.maven.plugin.license.Callback
    • onExistingHeader

      public void onExistingHeader(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header)
      Specified by:
      onExistingHeader in interface com.mycila.maven.plugin.license.Callback
    • hadFailure

      public boolean hadFailure()
      Description copied from interface: CallbackWithFailure
      Returns true if at least one file triggered a header violation during processing.
      Specified by:
      hadFailure in interface CallbackWithFailure
      Returns:
      true when there were failures
    • getAffected

      public Collection<File> getAffected()
      Description copied from interface: CallbackWithFailure
      Returns all files that were affected (missing header or reformatted, depending on the concrete implementation).
      Specified by:
      getAffected in interface CallbackWithFailure
      Returns:
      the affected files, never null