Fork me on GitHub

Plugin Documentation

Goals available for this plugin:

Goal Report? Description
license:add-third-party No Goal to generate the third-party license file.

This file contains a list of the dependencies and their licenses. Each dependency and its license is displayed on a single line in the format

  (<license-name>) <project-name> <groupId>:<artifactId>:<version> - <project-url>
The directory containing the license database file is added to the classpath as an additional resource.
license:aggregate-add-third-party No This goal forks executions of the add-third-party goal for all the leaf projects of the tree of modules below the point where it is executed. Note that this plugin sets a specific name, 'add-third-party', for the forked executions in the individual projects. From command level, then even though the execution of this goal is named 'default-cli', the forked executions have the name 'add-third-party'. Thus, to use the pluginManagement element of the POM to set options, you have to name the execution 'add-third-party', not 'default-cli'.
license:aggregate-download-licenses No Download the license files of all aggregated dependencies of the current project, and generate a summary file containing a list of all dependencies and their licenses.

The license files will be downloaded to AbstractDownloadLicensesMojo.licensesOutputDirectory to be included in the final packaging of the project if desired. The licenses are downloaded from the url field of the dependency POM.

If the license information (license name and license URL) is missing or otherwise broken in a dependency POM, this mojo offers several fallback options:

  • AbstractDownloadLicensesMojo.licensesConfigFile
  • AbstractDownloadLicensesMojo.errorRemedy
  • AbstractDownloadLicensesMojo.licenseUrlReplacements
  • AbstractDownloadLicensesMojo.licenseUrlFileNames
Created on 23/05/16.
license:aggregate-third-party-report Yes Generates a report of all third-parties detected in the module. Created on 22/05/16.
license:check-file-header No The goal to check if the state of header on project source files.
license:comment-style-list No Displays all the available comment style to box file headers.
license:download-licenses No Download the license files of all the current project's dependencies, and generate a summary file containing a list of all dependencies and their licenses.

The license files will be downloaded to AbstractDownloadLicensesMojo.licensesOutputDirectory to be included in the final packaging of the project if desired. The licenses are downloaded from the url field of the dependency POM.

If the license information (license name and license URL) is missing or otherwise broken in a dependency POM, this mojo offers several fallback options:

  • AbstractDownloadLicensesMojo.licensesConfigFile
  • AbstractDownloadLicensesMojo.errorRemedy
  • AbstractDownloadLicensesMojo.licenseUrlReplacements
  • AbstractDownloadLicensesMojo.licenseUrlFileNames
license:help No Display help information on license-maven-plugin.
Call mvn license:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
license:license-list No Display all available licenses.
license:licenses-xml-insert-versions No Insert versions into a licenses.xml file that might have been generated by a *download-licenses mojo with writeVersions set to false.
license:remove-file-header No The goal to remove the header on project source files.
license:third-party-report Yes Generates a report of all third-parties detected in the module.
license:update-file-header No The goal to update (or add) the header on project source files.

This goal replace the update-header goal which can not deal with Copyright.

This goal use a specific project file descriptor project.xml to describe all files to update for a whole project.

license:update-project-license No Updates (or creates) the main project license file according to the given license defines as licenseName. Can also generate a bundled license file (to avoid collision names in class-path). This file is by default generated in META-INF class-path directory.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.5.4
JDK 1.7
Memory No minimum requirement.
Disk Space No minimum requirement.

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.0.0</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>2.0.0</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
  <!-- To use the report goals in your POM or parent POM -->
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>2.0.0</version>
      </plugin>
      ...
    </plugins>
  </reporting>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"