Author: tchemit Date: 2010-06-26 14:08:42 +0200 (Sat, 26 Jun 2010) New Revision: 1787 Url: http://nuiton.org/repositories/revision/maven-license-plugin/1787 Log: add example for merge licenses Modified: trunk/src/site/apt/usage.apt trunk/src/site/fr/apt/usage.apt trunk/src/site/site_en.xml trunk/src/site/site_fr.xml Modified: trunk/src/site/apt/usage.apt =================================================================== --- trunk/src/site/apt/usage.apt 2010-06-26 11:41:13 UTC (rev 1786) +++ trunk/src/site/apt/usage.apt 2010-06-26 12:08:42 UTC (rev 1787) @@ -93,6 +93,8 @@ Once the file filled, just relaunch the goal to integrate your modifications in the generated <<THIRD-PARTY>> file. +*** Example + Here is a <<THIRD-PARTY>> file with unamed licenses launched by -------------------------------------------------------------------------------- @@ -198,18 +200,75 @@ to merge licenses added in <<THIRd-PARTY>> file, you have to add a <<licenseMerges>> to the plugin this configuration : + Each entry of <<licenseMerges>> describe a merge, the first license is the one to keep. + + +*** Example + + Given a pom with these dependencies : + ------------------------------------------------------------------------------- - <configuration> - <licenseMerges> - <licenseMerge> - Lesser General Public License (LGPL) v 3.0|Lesser General Public License (LGPL) - </licenseMerge> - </licenseMerges> - </configuration> + + <dependencies> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.1</version> + </dependency> + + <dependency> + <groupId>com.jhlabs</groupId> + <artifactId>filters</artifactId> + <version>2.0.235</version> + </dependency> + + </dependencies> ------------------------------------------------------------------------------- - Each entry of <<mergeLicenses>> describe a merge, the first license is the one to keep. + While executing <add-third-party> goal, we obtain the following <<THIRD-PARTY>> file : +------------------------------------------------------------------------------- +List of 2 third-party dependencies. + + (Apache License, Version 2.0) JHLabs Image Processing Filters (com.jhlabs:filters:2.0.235 - http://www.jhlabs.com/ip/index.html) + (The Apache Software License, Version 2.0) Commons Logging (commons-logging:commons-logging:1.1.1 - http://commons.apache.org/logging) +------------------------------------------------------------------------------- + + Now, adds this configuration in your pom + +------------------------------------------------------------------------------- + <pluginManagement> + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>2.3</version> + <executions> + <execution> + <id>default-cli</id> + <configuration> + <licenseMerges> + <licenseMerge>The Apache Software License, Version 2.0|Apache License, Version 2.0</licenseMerge> + </licenseMerges> + </configuration> + </execution> + </executions> + </plugin> + ... + </plugins> + </pluginManagement> +------------------------------------------------------------------------------- + + and relaunch the goal, we now obtain the following <<THIRD-PARTY>> file : + +------------------------------------------------------------------------------- +List of 2 third-party dependencies. + + (The Apache Software License, Version 2.0) Commons Logging (commons-logging:commons-logging:1.1.1 - http://commons.apache.org/logging) + (The Apache Software License, Version 2.0) JHLabs Image Processing Filters (com.jhlabs:filters:2.0.235 - http://www.jhlabs.com/ip/index.html) +------------------------------------------------------------------------------- + Get informations * license-list goal Modified: trunk/src/site/fr/apt/usage.apt =================================================================== --- trunk/src/site/fr/apt/usage.apt 2010-06-26 11:41:13 UTC (rev 1786) +++ trunk/src/site/fr/apt/usage.apt 2010-06-26 12:08:42 UTC (rev 1787) @@ -98,6 +98,8 @@ Une fois le fichier complété, il suffit de relancer le goal, le nouveau THIRD-PARTY généré intègrera les licenses complétées. +*** Exemple + Voici un fichier <<THIRD-PARTY.properties>> contenant des dépendances sans license généré en lançant la commande : @@ -202,21 +204,77 @@ ** Fusionner les licenses. Pour fusionner des licenses dans le fichier THIRd-PARTY, il faut utiliser - la configuration <<licenseMerges>>, comme dans l'exemple suivant : + la configuration <<licenseMerges>>. + Chaque entrée de <<licenseMerges>> décrit une fusion, la première license + étant celle à conserver. + +*** Exemple + + Soit le pom avec ces dépendences : + ------------------------------------------------------------------------------- - <configuration> - <licenseMerges> - <licenseMerge> - Lesser General Public License (LGPL) v 3.0|Lesser General Public License (LGPL) - </licenseMerge> - </licenseMerges> - </configuration> + + <dependencies> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.1</version> + </dependency> + + <dependency> + <groupId>com.jhlabs</groupId> + <artifactId>filters</artifactId> + <version>2.0.235</version> + </dependency> + + </dependencies> ------------------------------------------------------------------------------- - Chaque entrée de <<mergeLicenses>> décrit une fusion, la première license - étant celle à conserver. + On obtient le fichier <<THIRD-PARTY>> suivant : +------------------------------------------------------------------------------- +List of 2 third-party dependencies. + + (Apache License, Version 2.0) JHLabs Image Processing Filters (com.jhlabs:filters:2.0.235 - http://www.jhlabs.com/ip/index.html) + (The Apache Software License, Version 2.0) Commons Logging (commons-logging:commons-logging:1.1.1 - http://commons.apache.org/logging) +------------------------------------------------------------------------------- + + En ajoutant cela à la configuration du plugin + +------------------------------------------------------------------------------- + <pluginManagement> + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>2.3</version> + <executions> + <execution> + <id>default-cli</id> + <configuration> + <licenseMerges> + <licenseMerge>The Apache Software License, Version 2.0|Apache License, Version 2.0</licenseMerge> + </licenseMerges> + </configuration> + </execution> + </executions> + </plugin> + ... + </plugins> + </pluginManagement> +------------------------------------------------------------------------------- + + et en relançant le goal, on obtient le fichier <<THIRD-PARTY>> suivant : + +------------------------------------------------------------------------------- +List of 2 third-party dependencies. + + (The Apache Software License, Version 2.0) Commons Logging (commons-logging:commons-logging:1.1.1 - http://commons.apache.org/logging) + (The Apache Software License, Version 2.0) JHLabs Image Processing Filters (com.jhlabs:filters:2.0.235 - http://www.jhlabs.com/ip/index.html) +------------------------------------------------------------------------------- + Obtenir des informations * license-list goal Modified: trunk/src/site/site_en.xml =================================================================== --- trunk/src/site/site_en.xml 2010-06-26 11:41:13 UTC (rev 1786) +++ trunk/src/site/site_en.xml 2010-06-26 12:08:42 UTC (rev 1787) @@ -59,11 +59,11 @@ <item name="File header model" href="header.html"/> <item name="License project descriptor" href="descriptor.html"/> <item name="Usage" href="usage.html"> - <item name="License" href="usage.html#license"> + <item name="License" href="usage.html#License"> <item name="update-project-license" href="update-project-license-mojo.html"/> <item name="update-file-header" href="update-file-header-mojo.html"/> </item> - <item name="Third-party" href="usage.html#third-party"> + <item name="Third-party" href="usage.html#Third-party"> <item name="add-third-party" href="add-third-party-mojo.html"/> <item name="aggregate-add-third-party" href="aggregate-add-third-party-mojo.html"/> </item> Modified: trunk/src/site/site_fr.xml =================================================================== --- trunk/src/site/site_fr.xml 2010-06-26 11:41:13 UTC (rev 1786) +++ trunk/src/site/site_fr.xml 2010-06-26 12:08:42 UTC (rev 1787) @@ -58,11 +58,11 @@ <item name="Modèle de header de fichier" href="header.html"/> <item name="Descripteur de license du projet" href="descriptor.html"/> <item name="Usage" href="usage.html"> - <item name="License" href="usage.html#license"> + <item name="License" href="usage.html#License"> <item name="update-project-license" href="update-project-license-mojo.html"/> <item name="update-file-header" href="update-file-header-mojo.html"/> </item> - <item name="Third-party" href="usage.html#third-party"> + <item name="Third-party" href="usage.html#Third-party"> <item name="add-third-party" href="add-third-party-mojo.html"/> <item name="aggregate-add-third-party" href="aggregate-add-third-party-mojo.html"/> </item>