|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.license.plugin.AbstractLicenseMojo
org.nuiton.license.plugin.AbstractLicenseWithDescriptorMojo
org.nuiton.license.plugin.UpdateFileHeaderMojo
public class UpdateFileHeaderMojo
The goal to update (or add) the header on some files described in
AbstractLicenseWithDescriptorMojo.descriptor file.
update-header goal which can not deal with
Copyright.
This goal use a specific project file descriptor project.xml to
describe all files to update for a whole project.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin |
|---|
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging |
| Field Summary | |
|---|---|
protected boolean |
addSvnKeyWords
A flag to add svn:keywords on new header. |
protected boolean |
clearAfterOperation
A flag to clear everything after execution. |
protected boolean |
dryRun
A flag to test plugin but modify no file. |
protected UpdateFileHeaderFilter |
filter
|
protected FileHeader |
header
internal default file header |
protected String |
ignoreTag
A tag to place on files that will be ignored by the plugin. |
protected String |
inceptionYear
Inception year of the project. |
protected String |
organizationName
Name of project's organization. |
protected Set<File> |
processedFiles
set of processed files |
protected FileHeaderProcessor |
processor
|
protected String |
projectName
Name of project (or module). |
protected EnumMap<org.nuiton.license.plugin.UpdateFileHeaderMojo.FileState,Set<File>> |
result
by file state files treated |
protected boolean |
skipUpdateLicense
A flag to skip the goal. |
protected long |
timestamp
timestamp used for generation |
protected FileHeaderTransformer |
transformer
internal file header transformer |
protected boolean |
updateCopyright
A flag to update copyright application time (change copyright last year if required) according to the last commit made on the processed file. |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
|---|
ROLE |
| Constructor Summary | |
|---|---|
UpdateFileHeaderMojo()
|
|
| Method Summary | |
|---|---|
protected void |
clear()
|
void |
doAction()
|
protected void |
finalize()
|
protected void |
finalizeFile(File file,
File processFile)
|
FileHeader |
getFileHeader()
|
Set<File> |
getFiles(org.nuiton.license.plugin.UpdateFileHeaderMojo.FileState state)
|
UpdateFileHeaderFilter |
getFilter()
|
String |
getIgnoreTag()
|
String |
getInceptionYear()
|
String |
getOrganizationName()
|
Set<File> |
getProcessedFiles()
|
FileHeaderProcessor |
getProcessor()
|
String |
getProjectName()
|
EnumMap<org.nuiton.license.plugin.UpdateFileHeaderMojo.FileState,Set<File>> |
getResult()
|
long |
getTimestamp()
|
FileHeaderTransformer |
getTransformer()
|
void |
init()
|
boolean |
isAddSvnKeyWords()
|
boolean |
isClearAfterOperation()
|
boolean |
isDryRun()
|
boolean |
isSkip()
When is sets to true, will skip execution. |
boolean |
isUpdateCopyright()
|
protected boolean |
processFile(File file,
File processFile)
Process the given file and save the result in the given
processFile. |
protected void |
processFileEntry(File entryBasedir,
String[] paths)
|
protected void |
processHeader(Header header)
|
protected void |
reportType(org.nuiton.license.plugin.UpdateFileHeaderMojo.FileState state,
StringBuilder buffer)
|
void |
setAddSvnKeyWords(boolean addSvnKeyWords)
|
void |
setClearAfterOperation(boolean clearAfterOperation)
|
void |
setDryRun(boolean dryRun)
|
void |
setFilter(UpdateFileHeaderFilter filter)
|
void |
setHeader(FileHeader header)
|
void |
setIgnoreTag(String ignoreTag)
|
void |
setInceptionYear(String inceptionYear)
|
void |
setOrganizationName(String organizationName)
|
void |
setProcessor(FileHeaderProcessor processor)
|
void |
setProjectName(String projectName)
|
void |
setSkip(boolean skipUpdateLicense)
Changes internal state skip to execute (or not) goal. |
void |
setSkipUpdateLicense(boolean skipUpdateLicense)
|
void |
setTimestamp(long timestamp)
|
void |
setTransformer(FileHeaderTransformer transformer)
|
void |
setUpdateCopyright(boolean updateCopyright)
|
| Methods inherited from class org.nuiton.license.plugin.AbstractLicenseWithDescriptorMojo |
|---|
buildDefaultFileHeader, checkSkip, getDescriptor, getEncoding, getLicense, getLicenseProjectDescriptor, getLicenseResolver, getLicenseStore, getMainLicense, getTransformer, getTransformers, isKeepBackup, setDescriptor, setEncoding, setKeepBackup, setLicenseProjectDescriptor, setLicenseResolver, setLicenseStore, setTransformers, validateLicenseProjectDescriptor |
| Methods inherited from class org.nuiton.license.plugin.AbstractLicenseMojo |
|---|
createLicenseStore, getBuildTimestamp, getProject, getSession, isVerbose, setProject, setSession, setVerbose |
| 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, 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.nuiton.license.plugin.header.FileHeaderProcessorConfiguration |
|---|
getLog |
| Methods inherited from interface org.nuiton.plugin.Plugin |
|---|
getProject, isVerbose, setProject, setVerbose |
| Methods inherited from interface org.apache.maven.plugin.Mojo |
|---|
execute, getLog, setLog |
| Field Detail |
|---|
protected String projectName
protected String organizationName
protected String inceptionYear
protected boolean addSvnKeyWords
Author, Id, Rev, URL and Date
protected boolean updateCopyright
protected String ignoreTag
%%Ignore-License
protected boolean skipUpdateLicense
protected boolean dryRun
protected boolean clearAfterOperation
protected FileHeaderProcessor processor
protected UpdateFileHeaderFilter filter
protected FileHeaderTransformer transformer
protected FileHeader header
protected long timestamp
protected Set<File> processedFiles
protected EnumMap<org.nuiton.license.plugin.UpdateFileHeaderMojo.FileState,Set<File>> result
| Constructor Detail |
|---|
public UpdateFileHeaderMojo()
| Method Detail |
|---|
public void init()
throws Exception
init in class AbstractLicenseWithDescriptorMojoException
public void doAction()
throws Exception
doAction in class org.nuiton.plugin.AbstractPluginException
protected void processHeader(Header header)
throws IOException
IOException
protected void processFileEntry(File entryBasedir,
String[] paths)
throws IOException
IOException
protected boolean processFile(File file,
File processFile)
throws IOException
file and save the result in the given
processFile.
file - the file to processprocessFile - the ouput processed file
true if processFile can be finalize, otherwise need to be delete
IOException - if any pb while treatment
protected void finalizeFile(File file,
File processFile)
throws IOException
IOException
protected void finalize()
throws Throwable
finalize in class ObjectThrowableprotected void clear()
protected void reportType(org.nuiton.license.plugin.UpdateFileHeaderMojo.FileState state,
StringBuilder buffer)
public boolean isClearAfterOperation()
public long getTimestamp()
public String getProjectName()
public String getInceptionYear()
public String getOrganizationName()
public boolean isUpdateCopyright()
public String getIgnoreTag()
public boolean isDryRun()
public UpdateFileHeaderFilter getFilter()
public FileHeader getFileHeader()
getFileHeader in interface FileHeaderProcessorConfigurationpublic FileHeaderTransformer getTransformer()
getTransformer in interface FileHeaderProcessorConfigurationpublic boolean isSkip()
AbstractLicenseWithDescriptorMojotrue, will skip execution.
This will take effects in method AbstractLicenseWithDescriptorMojo.checkSkip().
So the method AbstractPlugin.doAction() will never be invoked.
isSkip in class AbstractLicenseWithDescriptorMojotrue if goal will not be executedpublic Set<File> getProcessedFiles()
public EnumMap<org.nuiton.license.plugin.UpdateFileHeaderMojo.FileState,Set<File>> getResult()
public Set<File> getFiles(org.nuiton.license.plugin.UpdateFileHeaderMojo.FileState state)
public boolean isAddSvnKeyWords()
public FileHeaderProcessor getProcessor()
public void setSkip(boolean skipUpdateLicense)
AbstractLicenseWithDescriptorMojoskip to execute (or not) goal.
setSkip in class AbstractLicenseWithDescriptorMojoskipUpdateLicense - new state valuepublic void setDryRun(boolean dryRun)
public void setTimestamp(long timestamp)
public void setProjectName(String projectName)
public void setSkipUpdateLicense(boolean skipUpdateLicense)
public void setInceptionYear(String inceptionYear)
public void setOrganizationName(String organizationName)
public void setUpdateCopyright(boolean updateCopyright)
public void setIgnoreTag(String ignoreTag)
public void setAddSvnKeyWords(boolean addSvnKeyWords)
public void setClearAfterOperation(boolean clearAfterOperation)
public void setTransformer(FileHeaderTransformer transformer)
public void setHeader(FileHeader header)
public void setProcessor(FileHeaderProcessor processor)
public void setFilter(UpdateFileHeaderFilter filter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||