@Mojo(name="add-third-party",
requiresProject=true,
requiresDependencyResolution=TEST,
defaultPhase=GENERATE_RESOURCES)
public class AddThirdPartyMojo
extends AbstractAddThirdPartyMojo
implements MavenProjectDependenciesConfigurator
(<license-name>) <project-name> <groupId>:<artifactId>:<version> - <project-url>The directory containing the license database file is added to the classpath as an additional resource.
AbstractAddThirdPartyMojo.ExcludedLicenses, AbstractAddThirdPartyMojo.IncludedLicenses| Constructor and Description |
|---|
AddThirdPartyMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkPackaging()
Check if the project packaging is acceptable for the mojo.
|
protected boolean |
checkSkip()
Checks if the mojo execution should be skipped.
|
protected SortedProperties |
createUnsafeMapping()
Creates the unsafe mapping (says dependencies with no license given by their pom).
|
protected void |
doAction()
Do plugin action.
|
String |
getExcludedArtifacts() |
String |
getExcludedGroups() |
List<String> |
getExcludedScopes() |
String |
getIncludedArtifacts() |
String |
getIncludedGroups() |
List<String> |
getIncludedScopes() |
boolean |
isIncludeTransitiveDependencies() |
boolean |
isSkip()
When is sets to
true, will skip execution. |
protected SortedMap<String,org.apache.maven.project.MavenProject> |
loadDependencies()
Loads the dependencies of the project (as
MavenProject, indexed by their gav. |
checkForbiddenLicenses, checkUnsafeDependencies, getExcludedLicenses, getHelper, getIncludedLicenses, getLicenseMap, getMissingFile, getOutputDirectory, getProjectDependencies, getUnsafeDependencies, getUnsafeMappings, init, isDoGenerate, isDoGenerateBundle, isFailIfWarning, isForce, isUseMissingFile, setExcludedLicenses, setIncludedLicenses, writeThirdPartyFileacceptPackaging, addResourceDir, afterExecute, checkEncoding, execute, getBuildTimestamp, getEncoding, getProject, getSession, hasClassPath, isVerbose, rejectPackaging, setEncoding, setVerbosegetLog, getPluginContext, setLog, setPluginContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisVerbosepublic boolean isSkip()
true, will skip execution.
This will take effect in at the very begin of the AbstractLicenseMojo.execute()
before any initialisation of goal.isSkip in class AbstractLicenseMojotrue if goal will not be executedprotected boolean checkPackaging()
AbstractLicenseMojo.execute().
Tip: There is two method to simplify the packaging check :
AbstractLicenseMojo.acceptPackaging(String...)
and
AbstractLicenseMojo.rejectPackaging(String...)checkPackaging in class AbstractLicenseMojotrue if can execute the goal for the packaging of the
project, false otherwise.protected boolean checkSkip()
checkSkip in class AbstractLicenseMojofalse if the mojo should not be executed.protected void doAction()
throws Exception
AbstractLicenseMojo.execute() invoke this method only and only if :
AbstractLicenseMojo.checkPackaging() returns true.AbstractLicenseMojo.init() returns true.doAction in class AbstractLicenseMojoException - if anyprotected SortedMap<String,org.apache.maven.project.MavenProject> loadDependencies()
MavenProject, indexed by their gav.loadDependencies in class AbstractAddThirdPartyMojoprotected SortedProperties createUnsafeMapping() throws org.apache.maven.project.ProjectBuildingException, IOException, ThirdPartyToolException
createUnsafeMapping in class AbstractAddThirdPartyMojoorg.apache.maven.project.ProjectBuildingException - if could not create maven porject for some dependenciesIOException - if could not load missing fileThirdPartyToolException - for third party tool errorpublic String getExcludedGroups()
getExcludedGroups in interface MavenProjectDependenciesConfiguratorartifactId, if null is setted the no exclude is
done on artifactId.public String getIncludedGroups()
getIncludedGroups in interface MavenProjectDependenciesConfiguratorgroupId, if null is setted then include
all artifacts.public List<String> getExcludedScopes()
getExcludedScopes in interface MavenProjectDependenciesConfiguratornull is setted, then include all scopes.public List<String> getIncludedScopes()
getIncludedScopes in interface MavenProjectDependenciesConfiguratornull is setted, then include all scopes.public String getExcludedArtifacts()
getExcludedArtifacts in interface MavenProjectDependenciesConfiguratorgroupId, if null is setted then no exclude
is done on groupId.public String getIncludedArtifacts()
getIncludedArtifacts in interface MavenProjectDependenciesConfiguratorartificatId, if null is setted then include
all artifacts.public boolean isIncludeTransitiveDependencies()
isIncludeTransitiveDependencies in interface MavenProjectDependenciesConfiguratortrue if should include transitive dependencies, false to include only direct
dependencies.Copyright © 2010–2014 Codehaus. All rights reserved.