Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I list all licenses used in a maven project?

Tags:

java

maven

I have a multimodule project that has a lot of dependencies. I want to check which licenses it had at a certain point, and see how many licenses were added since then. Is there an easy way to do this?

I found these plugins:

  1. https://maven.apache.org/plugins/maven-project-info-reports-plugin/license-mojo.html
  2. http://www.mojohaus.org/license-maven-plugin/examples/example-download-licenses.html

But neither of these give me exactly what I want. I have to do a lot of post processing after this. Is there a more direct way to see the list of licenses used in a maven project?

like image 924
Daniel Kaplan Avatar asked Apr 15 '16 16:04

Daniel Kaplan


People also ask

Where can I find Maven dependencies?

In your project's POM, press Ctrl and hover the mouse over the dependency. Click the dependency to open the dependency's POM. In the dependency POM, view the active dependency, its transitive dependencies and their versions. You can check the origin from which the dependency was pulled in.

What is Maven project Info reports Plugin?

The Maven Project Info Reports plugin is used to generate reports information about the project.

Which Maven command is to list all dependencies of a project hierarchically?

In Maven, you can use mvn dependency:tree to display the project dependencies in tree format.

What is used by Maven to store project details?

What is a POM? A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project.


1 Answers

I've developed a website, https://www.licensediscovery.io, that will help Java developers to find licenses for the artifacts that they and their software are depending on.

Licensediscovery.io enables users to search for Java artifacts by using any of the following syntaxes: Maven, Gradle, SBT, Ivy, Leiningen, Grape, Buildr or plain. Licensediscovery.io will collect, parse and present all identifiable Java artifacts and present them and their licenses in either a table, bar chart, donut chart or a network graph.

You can easily export all Maven dependencies from your project into a plain-format dependency list and use it to search for licenses in LicenseDiscovery.io (An example is available under the 'Documentation'-section on the website). LicenseDiscovery.io will try to find all the artifacts and their corresponding licenses. The result can then be exported into a CSV file. You can download the result on fixed interval and then compare them over time.

like image 129
Karl Dahlgren Avatar answered Sep 24 '22 16:09

Karl Dahlgren