Class LicenseFormatMojo
java.lang.Object
nl.javadude.gradle.plugins.license.maven.LicenseFormatMojo
- All Implemented Interfaces:
com.mycila.maven.plugin.license.Callback,CallbackWithFailure
CallbackWithFailure implementation for format mode: rewrites files that are missing
their license header, optionally replacing any existing header first.
In dry-run mode the result is written to a .licensed copy instead of the original file.
Inlined from hierynomus/license-gradle-plugin.
- Since:
- 1.1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLicenseFormatMojo(File basedir, boolean dryRun, boolean skipExistingHeaders) -
Method Summary
Modifier and TypeMethodDescriptionReturns all files that were affected (missing header or reformatted, depending on the concrete implementation).booleanReturnstrueif at least one file triggered a header violation during processing.voidonExistingHeader(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header) voidonHeaderNotFound(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header) voidonUnknownFile(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header)
-
Field Details
-
modifiedFiles
-
-
Constructor Details
-
LicenseFormatMojo
-
-
Method Details
-
onHeaderNotFound
public void onHeaderNotFound(com.mycila.maven.plugin.license.document.Document document, com.mycila.maven.plugin.license.header.Header header) - Specified by:
onHeaderNotFoundin interfacecom.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:
onUnknownFilein interfacecom.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:
onExistingHeaderin interfacecom.mycila.maven.plugin.license.Callback
-
hadFailure
public boolean hadFailure()Description copied from interface:CallbackWithFailureReturnstrueif at least one file triggered a header violation during processing.- Specified by:
hadFailurein interfaceCallbackWithFailure- Returns:
truewhen there were failures
-
getAffected
Description copied from interface:CallbackWithFailureReturns all files that were affected (missing header or reformatted, depending on the concrete implementation).- Specified by:
getAffectedin interfaceCallbackWithFailure- Returns:
- the affected files, never
null
-