Package org.codehaus.mojo.license
Class AggregatorAddThirdPartyMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.license.AbstractLicenseMojo
org.codehaus.mojo.license.AbstractAddThirdPartyMojo
org.codehaus.mojo.license.AggregatorAddThirdPartyMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="aggregate-add-third-party",
aggregator=true,
defaultPhase=GENERATE_RESOURCES,
requiresDependencyResolution=TEST,
threadSafe=true)
public class AggregatorAddThirdPartyMojo
extends AbstractAddThirdPartyMojo
This goal forks executions of the add-third-party goal for all the leaf projects
of the tree of modules below the point where it is executed. Note that this
plugin sets a specific name, 'add-third-party', for the forked executions in the
individual projects. From command level, then
even though the execution of this goal is named 'default-cli', the forked executions
have the name 'add-third-party'. Thus, to use the pluginManagement element of
the POM to set options, you have to name the execution 'add-third-party',
not 'default-cli'.
- Since:
- 1.0
- Author:
- tchemit dev@tchemit.fr
-
Nested Class Summary
Nested classes/interfaces inherited from class org.codehaus.mojo.license.AbstractAddThirdPartyMojo
AbstractAddThirdPartyMojo.ExcludedLicenses, AbstractAddThirdPartyMojo.IncludedLicenses -
Field Summary
Fields inherited from class org.codehaus.mojo.license.AbstractAddThirdPartyMojo
acceptPomPackaging, artifactFiltersUrl, bundleThirdPartyPath, dependencies, deployMissingFile, doGenerate, doGenerateBundle, excludedArtifacts, excludedGroups, excludedLicenses, excludedScopes, excludedTypes, failIfWarning, failOnBlacklist, failOnMissing, fileTemplate, force, generateBundle, includedArtifacts, includedGroups, includedLicenses, includedScopes, includedTypes, licenseMap, licenseMerges, licenseMergesFile, licenseMergesUrl, missingFile, missingFileUrl, missingLicensesFileArtifact, outputDirectory, projectDependencies, resolvedOverrideUrl, sortArtifactByName, thirdPartyFilename, unsafeDependencies, unsafeMappings, useMissingFile, useRepositoryMissingFilesFields inherited from class org.codehaus.mojo.license.AbstractLicenseMojo
projectHelperFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsConstructorDescriptionAggregatorAddThirdPartyMojo(ThirdPartyTool thirdPartyTool, DependenciesTool dependenciesTool, org.apache.maven.project.MavenProjectHelper projectHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanCheck if the project packaging is acceptable for the mojo.protected SortedPropertiesCreates the unsafe mapping (says dependencies with no license given by their pom).protected voiddoAction()Do plugin action.protected voidinit()Method to initialize the mojo before doing any concrete actions.booleanisSkip()When is sets totrue, will skip execution.Loads the dependencies of the project (asMavenProject, indexed by their gav.protected booleanChecks if the mojo execution should be skipped.Methods inherited from class org.codehaus.mojo.license.AbstractAddThirdPartyMojo
getHelper, setExcludedLicenses, setIncludedLicensesMethods inherited from class org.codehaus.mojo.license.AbstractLicenseMojo
acceptPackaging, addResourceDir, afterExecute, checkEncoding, execute, getEncoding, getProject, hasClassPath, isVerbose, rejectPackaging, setEncoding, setVerboseMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
AggregatorAddThirdPartyMojo
@Inject public AggregatorAddThirdPartyMojo(ThirdPartyTool thirdPartyTool, DependenciesTool dependenciesTool, org.apache.maven.project.MavenProjectHelper projectHelper)
-
-
Method Details
-
isSkip
public boolean isSkip()When is sets totrue, will skip execution. This will take effect in at the very begin of theAbstractLicenseMojo.execute()before any initialisation of goal.- Specified by:
isSkipin classAbstractLicenseMojo- Returns:
trueif goal will not be executed
-
checkPackaging
protected boolean checkPackaging()Check if the project packaging is acceptable for the mojo. By default, accept all packaging types. Note: This method is the first instruction to be executed in theAbstractLicenseMojo.execute(). Tip: There is two method to simplify the packaging check :AbstractLicenseMojo.acceptPackaging(String...)andAbstractLicenseMojo.rejectPackaging(String...)- Overrides:
checkPackagingin classAbstractLicenseMojo- Returns:
trueif can execute the goal for the packaging of the project,falseotherwise.
-
shouldSkip
protected boolean shouldSkip()Checks if the mojo execution should be skipped.- Overrides:
shouldSkipin classAbstractLicenseMojo- Returns:
trueif the mojo should not be executed.
-
init
Description copied from class:AbstractAddThirdPartyMojoMethod to initialize the mojo before doing any concrete actions. Note: The method is invoked before theAbstractLicenseMojo.doAction()method.- Overrides:
initin classAbstractAddThirdPartyMojo- Throws:
Exception- if any
-
doAction
Do plugin action. The methodAbstractLicenseMojo.execute()invoke this method only and only if :AbstractLicenseMojo.checkPackaging()returnstrue.- method
AbstractLicenseMojo.init()returnstrue.
- Specified by:
doActionin classAbstractLicenseMojo- Throws:
Exception- if any
-
loadDependencies
Loads the dependencies of the project (asMavenProject, indexed by their gav.- Specified by:
loadDependenciesin classAbstractAddThirdPartyMojo- Returns:
- the map of dependencies of the maven project indexed by their gav.
-
createUnsafeMapping
protected SortedProperties createUnsafeMapping() throws org.apache.maven.project.ProjectBuildingException, IOException, org.apache.maven.plugin.MojoExecutionExceptionCreates the unsafe mapping (says dependencies with no license given by their pom).Can come from loaded missing file or from dependencies with no license at all.
- Specified by:
createUnsafeMappingin classAbstractAddThirdPartyMojo- Returns:
- the map of usafe mapping indexed by their gav.
- Throws:
org.apache.maven.project.ProjectBuildingException- if could not create maven project for some dependenciesIOException- if could not load missing fileorg.apache.maven.plugin.MojoExecutionException
-