Licensing Maven Plugin
Clone or download
Pull request Compare This branch is 31 commits ahead, 27 commits behind idcmp:master.


Getting Started:

$ mvn org.linuxstuff.maven:licensing-maven-plugin:check -DfailIfMissing=false

This will walk through your multimodule project and create
target/third-party-licensing.xml everywhere.

$ mvn org.linuxstuff.maven:licensing-maven-plugin:collect-reports

This will walk through your multimodule project, finding all those
third-party-licensing.xml files and aggregate them together into a

If you're attaching this to an execution, use:

$ mvn org.linuxstuff.maven:licensing-maven-plugin:aggregate

This will only generate a target/aggregated-third-party-licensing.xml in your parent project (without failing your build).


Here's an example licensing requirements XML file:

<?xml version="1.0" encoding="UTF-8"?>

        <!-- Many projects forget to include a <license/> block, so we need to explicitly list them here. -->
                <artifact id="org.springframework:web-mvc:3.0.6">
                        <license>Spring Source License</license>

        <!-- Sometimes different people call the same license the same thing, we fix this up here. -->
        <!-- Note that *we* understand different versions of the same license are effectively different -->
        <!-- licenses and do not coalesce those together. You may not care though. -->
                <license name="GPLv2">
                        <aka>GNU Public License Version 2</aka>
                        <aka>The GNU Public License, Version 2.0</aka>

        <!-- Maybe you don't like the GPL, maybe you don't like a particular countries open source license. Here's  -->
        <!-- where you declare which licenses you don't like. Other than AGPL/GPL, open source licenses don't really -->
        <!-- have an impact on your code, but sometimes people like to exclude the LGPL as the baby in the bathwater. -->

	<!-- And with any set of strict rules, there are exceptions. Here we list artifacts that we wish to make -->
	<!--exempt from failing dislike checks. -->



Here's an example of how to bind the plugin into your build:

	    <!-- You can specify more than one file here. -->
	  <!-- You can exclude your own stuff here -->
	 <!-- aggregate goal does not support failIf* configuration like above. -->
     <!-- The licensing requirements XML should live in its own separate project to avoid chicken/egg problems. -->


TODO attach aggregated-third-party-licensing.xml to be deployed
TODO format output XML 
TODO make a proper maven site for the plugin