org.nuiton.license.plugin
Class AddThirdPartyMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.license.plugin.AbstractLicenseMojo
              extended by org.nuiton.license.plugin.AbstractAddThirdPartyMojo
                  extended by 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

Le goal pour copier le fichier THIRD-PARTY.txt (contenant les licenses de toutes les dependances du projet) dans le classpath (et le generer s'il n'existe pas).

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 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  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, failIfWarning, force, generateBundle, groupByLicense, licenseMerges, missingFile, NO_DEPENDENCIES_MESSAGE, outputDirectory, thirdPartyFilename, useMissingFile
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AddThirdPartyMojo()
           
 
Method Summary
protected  org.apache.maven.project.MavenProject addArtifact(String id, org.apache.maven.artifact.Artifact artifact)
           
protected  boolean checkPackaging()
           
protected  boolean checkSkip()
           
protected  LicenseMap createLicenseMap()
           
protected  org.nuiton.io.SortedProperties createUnsafeMapping()
           
protected  void doAction()
           
 boolean isDoGenerateMissing()
           
 void setDoGenerateMissing(boolean doGenerateMissing)
           
protected  void writeMissingFile()
           
 
Methods inherited from class org.nuiton.license.plugin.AbstractAddThirdPartyMojo
checkUnsafeDependencies, getArtifactCache, getArtifactId, getArtifactName, getBundleThirdPartyPath, getEncoding, getLicenseMap, getMissingFile, getOutputDirectory, getThirdPartyFile, getThirdPartyFilename, getUnsafeDependencies, getUnsafeMappings, init, isDoGenerate, isDoGenerateBundle, isFailIfWarning, isForce, isGenerateBundle, isGroupByLicense, isUseMissingFile, setBundleThirdPartyPath, setDoGenerate, setDoGenerateBundle, setEncoding, setFailIfWarning, setForce, setGenerateBundle, setGroupByLicense, setMissingFile, setOutputDirectory, setThirdPartyFile, setThirdPartyFilename, setUseMissingFile, writeThirdPartyFile
 
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, 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
 

Field Detail

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.
Constructor Detail

AddThirdPartyMojo

public AddThirdPartyMojo()
Method Detail

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

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)


Copyright © 2008-2010 CodeLutin. All Rights Reserved.