From da991619a0cd45c82920ec64a2acac98ba6a90a7 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Sat, 25 Feb 2012 20:57:51 +0000 Subject: NO-JIRA: rename the felix dep, we are using the 'main' bundle not the 'framework' one. Enable specifying dependency exclusions during POM generation, exclude deps we dont use in the build git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1293690 13f79535-47bb-0310-9956-ffa450edef68 --- java/genpom | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'java/genpom') diff --git a/java/genpom b/java/genpom index 39eccd4c3e..07a5b82a1f 100755 --- a/java/genpom +++ b/java/genpom @@ -73,13 +73,15 @@ if opts.name is None: if opts.artifact is None: opts.artifact = opts.name -def lookup(dep, attr): - nd = dep["dep"][attr] +def lookup(doc, attr): + nd = doc[attr] if nd is None: - if nd is None: - return None + return None return nd.text() +def lookupElement(doc, attr): + return doc[attr] + def search(path, file): for d in path: f = os.path.join(d, file) @@ -120,6 +122,7 @@ for jar in jars: continue else: die("unable to locate xml for %s" % jar) + dep = dep["dep"] group = lookup(dep, "groupId") artifactId = lookup(dep, "artifactId") version = lookup(dep, "version") @@ -128,11 +131,28 @@ for jar in jars: %s %s %s - %s - -""" % (group, artifactId, version, + %s""" % (group, artifactId, version, scopes.get(artifactId, "compile"))) + exclusions = lookupElement(dep, "exclusions") + if exclusions is not None: + deps.append(""" + """) + for exclusion in list(exclusions.query["exclusion"]): + group = lookup(exclusion, "groupId") + artifactId = lookup(exclusion, "artifactId") + deps.append(""" + + %s + %s + """ % (group, artifactId)) + deps.append(""" + """) + + deps.append(""" + +""") + TEMPLATE = """