Class ProjectLicense

java.lang.Object
org.codehaus.mojo.license.download.ProjectLicense
All Implemented Interfaces:
Cloneable

public class ProjectLicense extends Object implements Cloneable
The license subelement of ProjectLicenseInfo.
Since:
1.17
  • Constructor Details

    • ProjectLicense

      public ProjectLicense()
      The default constructor.
    • ProjectLicense

      public ProjectLicense(org.apache.maven.model.License license)
      Equivalent to new ProjectLicense( license.getName(), license.getUrl(), license.getDistribution(), license.getComments(), null )
      Parameters:
      license - the license to get name, URL, ditribution and comments from
    • ProjectLicense

      public ProjectLicense(String name, String url, String distribution, String comments, String file)
      The full constructor.
      Parameters:
      name - a human readable license name
      url - a URL from where the license text can be downloaded
      distribution - see getDistribution()
      comments - additional information related to this license
      file - file name without path
  • Method Details

    • getComments

      public String getComments()
      Get addendum information pertaining to this license.
      Returns:
      String
    • getDistribution

      public String getDistribution()
      Get the primary method by which this project may be distributed.
      repo
      may be downloaded from the Maven repository
      manual
      user must manually download and install the dependency.
      Returns:
      String
    • getName

      public String getName()
      Get the full legal name of the license.
      Returns:
      String
    • getUrl

      public String getUrl()
      Get the official url for the license text.
      Returns:
      String
    • getFile

      public String getFile()
      Returns the name of the license file (without path) downloaded from url.
      Returns:
      a path or null
    • setComments

      public void setComments(String comments)
      Set addendum information pertaining to this license.
      Parameters:
      comments -
    • setDistribution

      public void setDistribution(String distribution)
      Set the primary method by which this project may be distributed.
      repo
      may be downloaded from the Maven repository
      manual
      user must manually download and install the dependency.
      Parameters:
      distribution -
    • setName

      public void setName(String name)
      Set the full legal name of the license.
      Parameters:
      name -
    • setUrl

      public void setUrl(String url)
      Set the official url for the license text.
      Parameters:
      url -
    • setFile

      public void setFile(String file)
      Set the name of the license file (without path) downloaded from url.
      Parameters:
      file - the path to set
    • clone

      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object