Allow plugins to use self-provided licenses for used Maven Jars

maven_jar only allowed to use licenses that were defined in
'//lib:'. But plugins may need further licenses that are not yet in
core (E.g.: plugins/its-jira relies on a jar with CPL1.0
license). Since, plugins cannot add rules underneath '//lib:', we add
the local_license parameter to maven_jar, which allows plugins to use
licenses from ':' instead of '//lib:'.

Change-Id: Ib87339471585d3c6e6f2f8a90753bfd49c63b984
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/maven_jar.bucklet b/maven_jar.bucklet
index 48039ff..adccc15 100644
--- a/maven_jar.bucklet
+++ b/maven_jar.bucklet
@@ -60,7 +60,8 @@
     sha1 = '', bin_sha1 = '', src_sha1 = '',
     repository = MAVEN_CENTRAL,
     attach_source = True,
-    visibility = ['PUBLIC']):
+    visibility = ['PUBLIC'],
+    local_license = False):
   from os import path
 
   parts = id.split(':')
@@ -105,6 +106,11 @@
     out = binjar,
   )
 
+  license = ':LICENSE-' + license
+  if not local_license:
+    license = '//lib' + license
+  license = [license]
+
   if src_sha1 or attach_source:
     cmd = ['$(exe //bucklets/tools:download_file)', '-o', '$OUT', '-u', srcurl]
     if src_sha1: