[Arakhnę-Dev] [219] * Bug fix: thirdPartyLicenses parameter of the Maven license plugin is no more mandatory .

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 219
Author:   galland
Date:     2011-03-01 09:42:16 +0100 (Tue, 01 Mar 2011)
Log Message:
-----------
* Bug fix: thirdPartyLicenses parameter of the Maven license plugin is no more mandatory.

Modified Paths:
--------------
    trunk/maven-license-install-plugin/src/main/java/org/arakhne/maven/maven_license_install_plugin/InstallLicenseMojo.java

Modified: trunk/maven-license-install-plugin/src/main/java/org/arakhne/maven/maven_license_install_plugin/InstallLicenseMojo.java
===================================================================
--- trunk/maven-license-install-plugin/src/main/java/org/arakhne/maven/maven_license_install_plugin/InstallLicenseMojo.java	2011-02-28 13:24:33 UTC (rev 218)
+++ trunk/maven-license-install-plugin/src/main/java/org/arakhne/maven/maven_license_install_plugin/InstallLicenseMojo.java	2011-03-01 08:42:16 UTC (rev 219)
@@ -67,7 +67,6 @@
      * Third-party licenses. A file to license name map.
      * 
      * @parameter
-     * @required
      */
     protected String[] thirdPartyLicenses;
 
@@ -127,16 +126,18 @@
     	
     	Map<String,License> includedLicenses = new HashMap<String,License>();
     	Pattern re = Pattern.compile("^([^:]+):(.+)$"); //$NON-NLS-1$
-    	for(String tpl : this.thirdPartyLicenses) {
-    		Matcher matcher = re.matcher(tpl);
-    		if (matcher.matches()) {
-    			String l = matcher.group(1);
-    			String f = matcher.group(2);
-    			lic = License.parse(l, null);
-    			if (lic!=null) {
-    				includedLicenses.put(f, lic);
-    			}
-    		}
+    	if (this.thirdPartyLicenses!=null) {
+	    	for(String tpl : this.thirdPartyLicenses) {
+	    		Matcher matcher = re.matcher(tpl);
+	    		if (matcher.matches()) {
+	    			String l = matcher.group(1);
+	    			String f = matcher.group(2);
+	    			lic = License.parse(l, null);
+	    			if (lic!=null) {
+	    				includedLicenses.put(f, lic);
+	    			}
+	    		}
+	    	}
     	}
 
     	try {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/