org.nuiton.license.plugin
Class AddThirdPartyMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.license.plugin.AbstractLicenseMojo
org.nuiton.license.plugin.AbstractAddThirdPartyMojo
org.nuiton.license.plugin.AddThirdPartyMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding
public class AddThirdPartyMojo
- extends AbstractAddThirdPartyMojo
The gola to generate the third-party file.
This file contains for all dependencies of the project a line giving the
license used by the dependency.
It will also copy it in the class-path (says add the generated directory as
a resource of the build).
- Since:
- 2.2 (was previously
AddThirdPartyFileMojo).
- Author:
- tchemit
- Is defined by the goal name:
- add-third-party
- Is bound to the specified phase of the standard build lifecycle:
- generate-resources
- Requires the dependencies in this specified scope:
- test
- Requires a Maven project to run:
- true
| Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin |
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging |
|
Field Summary |
protected org.apache.maven.artifact.repository.ArtifactRepository |
localRepository
Local Repository. |
protected org.apache.maven.project.MavenProjectBuilder |
mavenProjectBuilder
Maven Project Builder component. |
protected List<?> |
remoteRepositories
Remote repositories used for the project. |
| Fields inherited from class org.nuiton.license.plugin.AbstractAddThirdPartyMojo |
bundleThirdPartyPath, excludedArtifacts, excludedGroups, failIfWarning, force, generateBundle, groupByLicense, includedArtifacts, includedGroups, licenseMerges, missingFile, NO_DEPENDENCIES_MESSAGE, outputDirectory, thirdPartyFilename, useMissingFile |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
| Methods inherited from class org.nuiton.license.plugin.AbstractAddThirdPartyMojo |
checkUnsafeDependencies, getArtifactCache, getBundleThirdPartyPath, getEncoding, getExcludedArtifacts, getExcludedGroups, getIncludedArtifacts, getIncludedGroups, getLicenseMap, getMissingFile, getOutputDirectory, getThirdPartyFile, getThirdPartyFilename, getUnsafeDependencies, getUnsafeMappings, init, isDoGenerate, isDoGenerateBundle, isFailIfWarning, isForce, isGenerateBundle, isGroupByLicense, isUseMissingFile, setBundleThirdPartyPath, setDoGenerate, setDoGenerateBundle, setEncoding, setExcludedArtifacts, setExcludedGroups, setFailIfWarning, setForce, setGenerateBundle, setGroupByLicense, setIncludedArtifacts, setIncludedGroups, setMissingFile, setOutputDirectory, setThirdPartyFile, setThirdPartyFilename, setUseMissingFile, writeThirdPartyFile |
| Methods inherited from class org.nuiton.plugin.AbstractPlugin |
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkEncoding, 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, 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 |
localRepository
protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
- Local Repository.
- Since:
- 1.0.0
- Is defined by:
- expression:
- ${localRepository}
- Is readonly.
- Is required.
remoteRepositories
protected List<?> remoteRepositories
- Remote repositories used for the project.
- Since:
- 1.0.0
- Is defined by:
- expression:
- ${project.remoteArtifactRepositories}
- Is readonly.
- Is required.
mavenProjectBuilder
protected org.apache.maven.project.MavenProjectBuilder mavenProjectBuilder
- Maven Project Builder component.
- Since:
- 1.0.0
- Is a Plexus component defined by:
- Is readonly.
- Is required.
AddThirdPartyMojo
public AddThirdPartyMojo()
checkPackaging
protected boolean checkPackaging()
- Overrides:
checkPackaging in class org.nuiton.plugin.AbstractPlugin
createLicenseMap
protected LicenseMap createLicenseMap()
throws org.apache.maven.project.ProjectBuildingException
- Specified by:
createLicenseMap in class AbstractAddThirdPartyMojo
- Throws:
org.apache.maven.project.ProjectBuildingException
createUnsafeMapping
protected org.nuiton.io.SortedProperties createUnsafeMapping()
throws org.apache.maven.project.ProjectBuildingException,
IOException
- Specified by:
createUnsafeMapping in class AbstractAddThirdPartyMojo
- Throws:
org.apache.maven.project.ProjectBuildingException
IOException
computeDoGenerateMissingFile
protected boolean computeDoGenerateMissingFile(org.nuiton.io.SortedProperties unsafeMappings,
SortedSet<org.apache.maven.project.MavenProject> unsafeDependencies)
throws IOException
- Parameters:
unsafeMappings - the unsafe mapping coming from the missing fileunsafeDependencies - the unsafe dependencies from the project
- Returns:
true if missing ifle should be (re-)generated, false otherwise
- Throws:
IOException - if any IO problem- Since:
- 3.0
checkSkip
protected boolean checkSkip()
- Overrides:
checkSkip in class org.nuiton.plugin.AbstractPlugin
doAction
protected void doAction()
throws Exception
- Specified by:
doAction in class org.nuiton.plugin.AbstractPlugin
- Throws:
Exception
writeMissingFile
protected void writeMissingFile()
throws IOException
- Throws:
IOException
addArtifact
protected org.apache.maven.project.MavenProject addArtifact(String id,
org.apache.maven.artifact.Artifact artifact)
throws org.apache.maven.project.ProjectBuildingException
- Throws:
org.apache.maven.project.ProjectBuildingException
isDoGenerateMissing
public boolean isDoGenerateMissing()
setDoGenerateMissing
public void setDoGenerateMissing(boolean doGenerateMissing)
isIncludable
protected boolean isIncludable(org.apache.maven.artifact.Artifact project,
Pattern includedGroupPattern,
Pattern includedArtifactPattern)
isExcludable
protected boolean isExcludable(org.apache.maven.artifact.Artifact project,
Pattern excludedGroupPattern,
Pattern excludedArtifactPattern)
Copyright © 2008-2010 CodeLutin. All Rights Reserved.