org.nuiton.license.plugin
Class AbstractLicenseNameMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.license.plugin.AbstractLicenseMojo
org.nuiton.license.plugin.AbstractLicenseNameMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding
- Direct Known Subclasses:
- UpdateFileHeaderMojo, UpdateProjectLicenseMojo
public abstract class AbstractLicenseNameMojo
- extends AbstractLicenseMojo
- implements org.nuiton.plugin.PluginWithEncoding
Abstract mojo which using a licenseName and owns a
licenseStore.
- Since:
- 2.1
- Author:
- tchemit
| Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin |
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
| Methods inherited from class org.nuiton.plugin.AbstractPlugin |
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkEncoding, checkPackaging, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, doAction, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile |
| 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.nuiton.plugin.Plugin |
getProject, isVerbose, setProject, setVerbose |
| Methods inherited from interface org.apache.maven.plugin.Mojo |
execute, getLog, setLog |
AbstractLicenseNameMojo
public AbstractLicenseNameMojo()
isSkip
public abstract boolean isSkip()
- When is sets to
true, will skip execution.
This will take effects in method checkSkip().
So the method AbstractPlugin.doAction() will never be invoked.
- Returns:
true if goal will not be executed
setSkip
public abstract void setSkip(boolean skip)
- Changes internal state
skip to execute (or not) goal.
- Parameters:
skip - new state value
checkSkip
protected boolean checkSkip()
- Overrides:
checkSkip in class org.nuiton.plugin.AbstractPlugin
init
protected void init()
throws Exception
- Specified by:
init in class org.nuiton.plugin.AbstractPlugin
- Throws:
Exception
getMainLicense
public License getMainLicense()
throws IllegalArgumentException,
IllegalStateException,
org.apache.maven.plugin.MojoFailureException
- Throws:
IllegalArgumentException
IllegalStateException
org.apache.maven.plugin.MojoFailureException
getLicense
public License getLicense(String licenseName)
throws IllegalArgumentException,
IllegalStateException
- Throws:
IllegalArgumentException
IllegalStateException
checkLicense
protected void checkLicense(String licenseName)
throws IllegalArgumentException,
IllegalStateException,
org.apache.maven.plugin.MojoFailureException
- Check if the given license name is valid (not null, nor empty) and
exists in the license store.
- Parameters:
licenseName - the name of the license to check
- Throws:
IllegalArgumentException - if license is not valid
IllegalStateException - if license store is not initialized
org.apache.maven.plugin.MojoFailureException - if license does not exist- Since:
- 2.4.1
getEncoding
public final String getEncoding()
- Specified by:
getEncoding in interface org.nuiton.plugin.PluginWithEncoding
setEncoding
public final void setEncoding(String encoding)
- Specified by:
setEncoding in interface org.nuiton.plugin.PluginWithEncoding
isKeepBackup
public boolean isKeepBackup()
getLicenseName
public String getLicenseName()
getLicenseResolver
public String getLicenseResolver()
getLicenseStore
public LicenseStore getLicenseStore()
setKeepBackup
public void setKeepBackup(boolean keepBackup)
setLicenseResolver
public void setLicenseResolver(String licenseResolver)
setLicenseName
public void setLicenseName(String licenseName)
setLicenseStore
public void setLicenseStore(LicenseStore licenseStore)
Copyright © 2008-2010 CodeLutin. All Rights Reserved.