com.soebes.maven.plugins.mlv
Class AbstractLicenseVerifierPlugIn

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by com.soebes.maven.plugins.mlv.AbstractLicenseVerifierPlugIn
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
LicenseVerifierMojo, LicenseVerifierReport

public abstract class AbstractLicenseVerifierPlugIn
extends org.apache.maven.plugin.AbstractMojo

Author:
Karl Heinz Marbaise

Field Summary
protected  List<String> excludes
          By using excludes you can exclude particular artifacts from being checked by the Maven Licenses Verifier Plugin.
protected  boolean failOnInvalid
          The build will fail if a license with the category Invalid has been found.
protected  boolean failOnUnknown
          The build will fail if a license can not be categorized in any of the categories.
protected  boolean failOnValid
          The build will fail if a license with the category Valid has been found.
protected  boolean failOnWarning
          The build will fail if a license with the category Warning has been found.
protected  File licenseFile
          The name of the licenses.xml file which will be used to categorize the licenses of the artifacts.
private  ArrayList<LicenseInformation> licenseInformations
          This is just for simplicity to store all license information here to make the checkings and other operation simpler.
private  HashMap<String,LicenseInformation> licenseList
           
protected  LicensesContainer licensesContainer
           
protected  LicenseValidator licenseValidator
           
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
          Location of the local repository.
protected  org.apache.maven.project.MavenProject project
          The Maven project.
protected  org.apache.maven.project.MavenProjectBuilder projectBuilder
          Used to build a maven projects from artifacts in the remote repository.
protected  List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
          List of Remote Repositories used by the resolver
private  boolean stricktChecking
          This will turn on strictChecking behavior which will check URL and Name of a license instead of only URL or Name.
private  boolean verbose
          This will turn on verbose behavior and will print out all information about the artifacts.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractLicenseVerifierPlugIn()
           
 
Method Summary
protected  void getDependArtifacts(Set<?> depArtifacts)
          Get all their dependencies and put the information into the intermediate list of licenses.
 ArrayList<LicenseInformation> getLicenseInformations()
           
 HashMap<String,LicenseInformation> getLicenseList()
           
 boolean isVerbose()
           
protected  void loadLicensesFile()
          This method will load the licenses.xml file.
 void setVerbose(boolean verbose)
           
 
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.apache.maven.plugin.Mojo
execute
 

Field Detail

project

protected org.apache.maven.project.MavenProject project
The Maven project.


projectBuilder

protected org.apache.maven.project.MavenProjectBuilder projectBuilder
Used to build a maven projects from artifacts in the remote repository.


localRepository

protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
Location of the local repository.


remoteRepositories

protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
List of Remote Repositories used by the resolver


verbose

private boolean verbose
This will turn on verbose behavior and will print out all information about the artifacts.


stricktChecking

private boolean stricktChecking
This will turn on strictChecking behavior which will check URL and Name of a license instead of only URL or Name.


failOnValid

protected boolean failOnValid
The build will fail if a license with the category Valid has been found.


failOnInvalid

protected boolean failOnInvalid
The build will fail if a license with the category Invalid has been found.


failOnWarning

protected boolean failOnWarning
The build will fail if a license with the category Warning has been found.


failOnUnknown

protected boolean failOnUnknown
The build will fail if a license can not be categorized in any of the categories.


licenseFile

protected File licenseFile
The name of the licenses.xml file which will be used to categorize the licenses of the artifacts.


excludes

protected List<String> excludes
By using excludes you can exclude particular artifacts from being checked by the Maven Licenses Verifier Plugin.
   <excludes>
      <exclude>groupId:artifactId:type:version</exclude>
      ..
   </excludes>
 


licenseInformations

private ArrayList<LicenseInformation> licenseInformations
This is just for simplicity to store all license information here to make the checkings and other operation simpler.


licenseList

private HashMap<String,LicenseInformation> licenseList

licenseValidator

protected LicenseValidator licenseValidator

licensesContainer

protected LicensesContainer licensesContainer
Constructor Detail

AbstractLicenseVerifierPlugIn

public AbstractLicenseVerifierPlugIn()
Method Detail

getDependArtifacts

protected void getDependArtifacts(Set<?> depArtifacts)
                           throws org.apache.maven.plugin.MojoExecutionException
Get all their dependencies and put the information into the intermediate list of licenses.

Parameters:
depArtifacts -
Throws:
org.apache.maven.plugin.MojoExecutionException

getLicenseList

public HashMap<String,LicenseInformation> getLicenseList()

getLicenseInformations

public ArrayList<LicenseInformation> getLicenseInformations()

loadLicensesFile

protected void loadLicensesFile()
                         throws org.apache.maven.plugin.MojoExecutionException
This method will load the licenses.xml file.

Throws:
org.apache.maven.plugin.MojoExecutionException

setVerbose

public void setVerbose(boolean verbose)

isVerbose

public boolean isVerbose()


Copyright © 2009-2011 SoftwareEntwicklung Beratung Schulung. All Rights Reserved.