Class License

java.lang.Object
org.apache.maven.api.model.License
All Implemented Interfaces:
Serializable, InputLocationTracker

Describes the licenses for this project. This is used to generate the license page of the project's website, as well as being taken into consideration in other reporting and validation. The licenses listed for the project are that of the project itself, and not of dependencies.
See Also:
  • Constructor Details

  • Method Details

    • getName

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

      public String getUrl()
      The official url for the license text.
      Returns:
      a String
    • getDistribution

      public String getDistribution()
      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:
      a String
    • getComments

      public String getComments()
      Addendum information pertaining to this license.
      Returns:
      a String
    • getLocation

      public InputLocation getLocation(Object key)
      Gets the location of the specified field in the input source.
      Specified by:
      getLocation in interface InputLocationTracker
    • getLocationKeys

      public Set<Object> getLocationKeys()
      Gets the keys of the locations of the input source.
    • getLocationKeyStream

      protected Stream<Object> getLocationKeyStream()
    • getImportedFrom

      public InputLocation getImportedFrom()
      Gets the input location that caused this model to be read.
      Specified by:
      getImportedFrom in interface InputLocationTracker
      Returns:
      InputLocation
    • with

      @Nonnull public License.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withName

      @Nonnull public License withName(String name)
      Creates a new License instance using the specified name.
      Parameters:
      name - the new String to use
      Returns:
      a License with the specified name
    • withUrl

      @Nonnull public License withUrl(String url)
      Creates a new License instance using the specified url.
      Parameters:
      url - the new String to use
      Returns:
      a License with the specified url
    • withDistribution

      @Nonnull public License withDistribution(String distribution)
      Creates a new License instance using the specified distribution.
      Parameters:
      distribution - the new String to use
      Returns:
      a License with the specified distribution
    • withComments

      @Nonnull public License withComments(String comments)
      Creates a new License instance using the specified comments.
      Parameters:
      comments - the new String to use
      Returns:
      a License with the specified comments
    • newInstance

      @Nonnull public static License newInstance()
      Creates a new License instance. Equivalent to newInstance(true).
      Returns:
      a new License
      See Also:
    • newInstance

      @Nonnull public static License newInstance(boolean withDefaults)
      Creates a new License instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new License
    • newBuilder

      @Nonnull public static License.Builder newBuilder()
      Creates a new License builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static License.Builder newBuilder(boolean withDefaults)
      Creates a new License builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static License.Builder newBuilder(License from)
      Creates a new License builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the License instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static License.Builder newBuilder(License from, boolean forceCopy)
      Creates a new License builder instance using the specified object as a basis.
      Parameters:
      from - the License instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: