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: Icc40c413eed65a0b6e3003021050d91086ca4c34
diff --git a/lib/maven.defs b/lib/maven.defs
index adce2a5..f11bd3c 100644
--- a/lib/maven.defs
+++ b/lib/maven.defs
@@ -42,7 +42,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(':')
@@ -91,7 +92,10 @@
cmd = ' '.join(cmd),
out = binjar,
)
- license = ['//lib:LICENSE-' + license]
+ license = ':LICENSE-' + license
+ if not local_license:
+ license = '//lib' + license
+ license = [license]
if src_sha1 or attach_source:
cmd = ['$(exe //tools:download_file)', '-o', '$OUT', '-u', srcurl]