org.codehaus.mojo.license
Class UpdateProjectLicenseMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.license.AbstractLicenseMojo
          extended by org.codehaus.mojo.license.AbstractLicenseNameMojo
              extended by org.codehaus.mojo.license.UpdateProjectLicenseMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class UpdateProjectLicenseMojo
extends AbstractLicenseNameMojo

Updates (or creates) the main project license file according to the given license defines as AbstractLicenseNameMojo.licenseName.

Can also generate a bundled license file (to avoid collision names in class-path). This file is by default generated in META-INF class-path directory.

Since:
1.0
Author:
tchemit

Field Summary
protected  String bundleLicensePath
          The path of the bundled license file to produce when generateBundle is on.
protected  boolean force
          A flag to force to generate project license file even if it is up-to-date.
protected  boolean generateBundle
          A flag to copy the main license file in a bundled place.
protected  File licenseFile
          Project license file to synchronize with main license defined in descriptor file.
protected  File outputDirectory
          The directory where to generate license resources.
protected  boolean skipUpdateProjectLicense
          A flag to skip the goal.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
UpdateProjectLicenseMojo()
           
 
Method Summary
protected  void doAction()
          Do plugin action.
 String getBundleLicensePath()
           
 File getLicenseFile()
           
 File getOutputDirectory()
           
protected  void init()
          Method to initialize the mojo before doing any concrete actions.
 boolean isDoGenerate()
           
 boolean isForce()
           
 boolean isGenerateBundle()
           
 boolean isSkip()
          When is sets to true, will skip execution.
 void setBundleLicensePath(String bundleLicensePath)
           
 void setDoGenerate(boolean doGenerate)
           
 void setForce(boolean force)
           
 void setGenerateBundle(boolean generateBundle)
           
 void setLicenseFile(File licenseFile)
           
 void setOutputDirectory(File outputDirectory)
           
 void setSkip(boolean skipUpdateProjectLicense)
          Changes internal state skip to execute (or not) goal.
 
Methods inherited from class org.codehaus.mojo.license.AbstractLicenseNameMojo
checkSkip, getLicense, getLicense, getLicenseName, getLicenseResolver, getLicenseStore, isKeepBackup, setKeepBackup, setLicenseName, setLicenseResolver, setLicenseStore
 
Methods inherited from class org.codehaus.mojo.license.AbstractLicenseMojo
acceptPackaging, addResourceDir, afterExecute, checkEncoding, checkPackaging, execute, getBuildTimestamp, getEncoding, getProject, getSession, hasClassPath, isVerbose, rejectPackaging, setEncoding, setProject, setSession, setVerbose
 
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
 

Field Detail

licenseFile

protected File licenseFile
Project license file to synchronize with main license defined in descriptor file.

Since:
1.0

outputDirectory

protected File outputDirectory
The directory where to generate license resources.

Note: This option is not available for pom module types.

Since:
1.0

generateBundle

protected boolean generateBundle
A flag to copy the main license file in a bundled place.

This is usefull for final application to have a none confusing location to seek for the application license.

If Sets to true, will copy the license file to the bundleLicensePath to outputDirectory.

Note: This option is not available for pom module types.

Since:
1.0

bundleLicensePath

protected String bundleLicensePath
The path of the bundled license file to produce when generateBundle is on.

Note: This option is not available for pom module types.

Since:
1.0

force

protected boolean force
A flag to force to generate project license file even if it is up-to-date.

Since:
1.0.0

skipUpdateProjectLicense

protected boolean skipUpdateProjectLicense
A flag to skip the goal.

Since:
1.0
Constructor Detail

UpdateProjectLicenseMojo

public UpdateProjectLicenseMojo()
Method Detail

init

protected void init()
             throws Exception
Description copied from class: AbstractLicenseMojo
Method to initialize the mojo before doing any concrete actions.

Note: The method is invoked before the AbstractLicenseMojo.doAction() method.

Overrides:
init in class AbstractLicenseNameMojo
Throws:
Exception - if any

doAction

protected void doAction()
                 throws Exception
Description copied from class: AbstractLicenseMojo
Do plugin action.

The method AbstractLicenseMojo.execute() invoke this method only and only if :

Specified by:
doAction in class AbstractLicenseMojo
Throws:
Exception - if any

getLicenseFile

public File getLicenseFile()

isGenerateBundle

public boolean isGenerateBundle()

getOutputDirectory

public File getOutputDirectory()

getBundleLicensePath

public String getBundleLicensePath()

isDoGenerate

public boolean isDoGenerate()

isForce

public boolean isForce()

isSkip

public boolean isSkip()
Description copied from class: AbstractLicenseNameMojo
When is sets to true, will skip execution.

This will take effects in method AbstractLicenseNameMojo.checkSkip(). So the method AbstractLicenseMojo.doAction() will never be invoked.

Specified by:
isSkip in class AbstractLicenseNameMojo
Returns:
true if goal will not be executed

setLicenseFile

public void setLicenseFile(File licenseFile)

setGenerateBundle

public void setGenerateBundle(boolean generateBundle)

setOutputDirectory

public void setOutputDirectory(File outputDirectory)

setBundleLicensePath

public void setBundleLicensePath(String bundleLicensePath)

setDoGenerate

public void setDoGenerate(boolean doGenerate)

setSkip

public void setSkip(boolean skipUpdateProjectLicense)
Description copied from class: AbstractLicenseNameMojo
Changes internal state skip to execute (or not) goal.

Specified by:
setSkip in class AbstractLicenseNameMojo
Parameters:
skipUpdateProjectLicense - new state value

setForce

public void setForce(boolean force)


Copyright © 2010-2013 The Kuali Foundation. All Rights Reserved.