org.codehaus.mojo.license
Interface ThirdPartyTool

All Known Implementing Classes:
DefaultThirdPartyTool

public interface ThirdPartyTool

A tool to load third party files missing files.

We should put here all the logic code written in some mojo and licenseMap...

Since:
1.0
Author:
tchemit

Field Summary
static String ROLE
          Plexus Role
 
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)
          Add a given licenses to the given licenseMap for the given project.
 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.
 SortedSet<org.apache.maven.project.MavenProject> getProjectsWithNoLicense(LicenseMap licenseMap, boolean doLog)
          From the given licenseMap, obtain all the projects with no license.
 SortedProperties loadThirdPartyDescriptorsForUnsafeMapping(String encoding, Collection<org.apache.maven.project.MavenProject> projects, SortedSet<org.apache.maven.project.MavenProject> unsafeProjects, 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.
 

Field Detail

ROLE

static final String ROLE
Plexus Role

Method Detail

loadThirdPartyDescriptorsForUnsafeMapping

SortedProperties loadThirdPartyDescriptorsForUnsafeMapping(String encoding,
                                                           Collection<org.apache.maven.project.MavenProject> projects,
                                                           SortedSet<org.apache.maven.project.MavenProject> unsafeProjects,
                                                           LicenseMap licenseMap,
                                                           org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                                           List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories)
                                                           throws ThirdPartyToolException,
                                                                  IOException
Parameters:
encoding - encoding used to read or write properties files
projects - all projects where to read third parties descriptors
unsafeProjects - all unsafe projects
licenseMap - license map where to store new licenses
localRepository - local repository
remoteRepositories - remote repositories
Returns:
the map of loaded missing from the remote missing third party files
Throws:
ThirdPartyToolException - if any
IOException - if any

attachThirdPartyDescriptor

void attachThirdPartyDescriptor(org.apache.maven.project.MavenProject project,
                                File file)
For the given 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.

Parameters:
project - the project on which to attch the third-party file
file - the third-party file to attach.

resolvThirdPartyDescriptor

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
Obtain the third party file from the repository.

Will first search in the local repository, then into the remote repositories and will resolv it.

Parameters:
project - the project
localRepository - the local repository
repositories - the remote repositories
Returns:
the locale file resolved into the local repository
Throws:
ThirdPartyToolException - if any

getProjectsWithNoLicense

SortedSet<org.apache.maven.project.MavenProject> getProjectsWithNoLicense(LicenseMap licenseMap,
                                                                          boolean doLog)
From the given licenseMap, obtain all the projects with no license.

Parameters:
licenseMap - the license map to query
doLog - a flag to add debug logs
Returns:
the set of projects with no license

loadUnsafeMapping

SortedProperties loadUnsafeMapping(LicenseMap licenseMap,
                                   SortedMap<String,org.apache.maven.project.MavenProject> artifactCache,
                                   String encoding,
                                   File missingFile)
                                   throws IOException
Throws:
IOException

addLicense

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.

Parameters:
licenseMap - the license map where to add the license
project - the project
licenseName - the name of the license

addLicense

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.

Parameters:
licenseMap - the license map where to add the license
project - the project
license - the license to add

addLicense

void addLicense(LicenseMap licenseMap,
                org.apache.maven.project.MavenProject project,
                List<?> licenses)
Add a given licenses to the given licenseMap for the given project.

Parameters:
licenseMap - the license map where to add the licenses
project - the project
licenses - the licenses to add

mergeLicenses

void mergeLicenses(LicenseMap licenseMap,
                   String... licenses)
For a given 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.

Parameters:
licenseMap - the license map to merge
licenses - all the licenses to merge (the first license will be the unique one to kkep)


Copyright © 2010-2012 The Kuali Foundation. All Rights Reserved.