|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.plexus.logging.AbstractLogEnabled
org.codehaus.mojo.license.DefaultThirdPartyTool
public class DefaultThirdPartyTool
Default implementation of the third party tool.
| Field Summary | |
|---|---|
static String |
DESCRIPTOR_CLASSIFIER
|
static String |
DESCRIPTOR_TYPE
|
| Fields inherited from interface org.codehaus.mojo.license.ThirdPartyTool |
|---|
ROLE |
| Constructor Summary | |
|---|---|
DefaultThirdPartyTool()
|
|
| Method Summary | |
|---|---|
void |
addLicense(LicenseMap licenseMap,
org.apache.maven.project.MavenProject project,
org.apache.maven.model.License license)
Add a given license to the given licenseMap for the given project. |
void |
addLicense(LicenseMap licenseMap,
org.apache.maven.project.MavenProject project,
List<?> licenses)
This does some cleanup, and basic safety checks on the license objects passed in 1 - Ignore system scoped dependencies 2 - If there are no licenses declared, use "Unknown License" 3 - If there is no name declared, but there is a url, use the url as a key 4 - If there is no name or url, use "Unknown License" as a key |
void |
addLicense(LicenseMap licenseMap,
org.apache.maven.project.MavenProject project,
String licenseName)
Add a license (name and url are licenseName) to the given licenseMap for the given
project. |
void |
attachThirdPartyDescriptor(org.apache.maven.project.MavenProject project,
File file)
For the given project, attach the given file as a third-party file. |
protected String |
getLicense(org.apache.maven.project.MavenProject d,
Properties mappings)
|
SortedSet<org.apache.maven.project.MavenProject> |
getProjectsWithNoLicense(LicenseMap licenseMap,
boolean doLog)
From the given licenseMap, obtain all the projects with no license. |
protected Properties |
getProperties(String encoding,
File file)
|
protected void |
handleStuff(Properties customMappings,
SortedMap<String,org.apache.maven.project.MavenProject> artifactCache)
|
protected void |
handleUnsafeDependencies(Set<org.apache.maven.project.MavenProject> deps,
Properties mappings,
LicenseMap licenseMap)
|
SortedProperties |
loadThirdPartyDescriptorsForUnsafeMapping(String encoding,
Collection<org.apache.maven.project.MavenProject> projects,
SortedSet<org.apache.maven.project.MavenProject> unsafeDependencies,
LicenseMap licenseMap,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories)
|
SortedProperties |
loadUnsafeMapping(LicenseMap licenseMap,
SortedMap<String,org.apache.maven.project.MavenProject> artifactCache,
String encoding,
File missingFile)
|
void |
mergeLicenses(LicenseMap licenseMap,
String... licenses)
For a given licenseMap, merge all licenses. |
File |
resolvThirdPartyDescriptor(org.apache.maven.project.MavenProject project,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
List<org.apache.maven.artifact.repository.ArtifactRepository> repositories)
Obtain the third party file from the repository. |
| Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DESCRIPTOR_CLASSIFIER
public static final String DESCRIPTOR_TYPE
| Constructor Detail |
|---|
public DefaultThirdPartyTool()
| Method Detail |
|---|
public void attachThirdPartyDescriptor(org.apache.maven.project.MavenProject project,
File file)
project, attach the given file as a third-party file.
The file will be attached as with a classifier third-parties and a type properties.
attachThirdPartyDescriptor in interface ThirdPartyToolproject - the project on which to attch the third-party filefile - the third-party file to attach.
public SortedSet<org.apache.maven.project.MavenProject> getProjectsWithNoLicense(LicenseMap licenseMap,
boolean doLog)
licenseMap, obtain all the projects with no license.
getProjectsWithNoLicense in interface ThirdPartyToollicenseMap - the license map to querydoLog - a flag to add debug logs
public SortedProperties loadThirdPartyDescriptorsForUnsafeMapping(String encoding,
Collection<org.apache.maven.project.MavenProject> projects,
SortedSet<org.apache.maven.project.MavenProject> unsafeDependencies,
LicenseMap licenseMap,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories)
throws ThirdPartyToolException,
IOException
loadThirdPartyDescriptorsForUnsafeMapping in interface ThirdPartyToolencoding - encoding used to read or write properties filesprojects - all projects where to read third parties descriptorsunsafeDependencies - all unsafe projectslicenseMap - license map where to store new licenseslocalRepository - local repositoryremoteRepositories - remote repositories
ThirdPartyToolException - if any
IOException - if any
public File resolvThirdPartyDescriptor(org.apache.maven.project.MavenProject project,
org.apache.maven.artifact.repository.ArtifactRepository localRepository,
List<org.apache.maven.artifact.repository.ArtifactRepository> repositories)
throws ThirdPartyToolException
resolvThirdPartyDescriptor in interface ThirdPartyToolproject - the projectlocalRepository - the local repositoryrepositories - the remote repositories
ThirdPartyToolException - if any
public void addLicense(LicenseMap licenseMap,
org.apache.maven.project.MavenProject project,
String licenseName)
licenseName) to the given licenseMap for the given
project.
addLicense in interface ThirdPartyToollicenseMap - the license map where to add the licenseproject - the projectlicenseName - the name of the license
public void addLicense(LicenseMap licenseMap,
org.apache.maven.project.MavenProject project,
org.apache.maven.model.License license)
license to the given licenseMap for the given project.
addLicense in interface ThirdPartyToollicenseMap - the license map where to add the licenseproject - the projectlicense - the license to add
public void addLicense(LicenseMap licenseMap,
org.apache.maven.project.MavenProject project,
List<?> licenses)
addLicense in interface ThirdPartyToollicenseMap - the license map where to add the licensesproject - the projectlicenses - the licenses to add
public void mergeLicenses(LicenseMap licenseMap,
String... licenses)
licenseMap, merge all licenses.
The first value of the licenses is the license to keep and all other values will be merged into the first
one.
mergeLicenses in interface ThirdPartyToollicenseMap - the license map to mergelicenses - all the licenses to merge (the first license will be the unique one to kkep)
protected Properties getProperties(String encoding,
File file)
throws IOException
IOException
protected void handleStuff(Properties customMappings,
SortedMap<String,org.apache.maven.project.MavenProject> artifactCache)
protected void handleUnsafeDependencies(Set<org.apache.maven.project.MavenProject> deps,
Properties mappings,
LicenseMap licenseMap)
protected String getLicense(org.apache.maven.project.MavenProject d,
Properties mappings)
public SortedProperties loadUnsafeMapping(LicenseMap licenseMap,
SortedMap<String,org.apache.maven.project.MavenProject> artifactCache,
String encoding,
File missingFile)
throws IOException
loadUnsafeMapping in interface ThirdPartyToolIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||