summaryrefslogtreecommitdiff
path: root/java/genpom
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2012-02-25 20:57:51 +0000
committerRobert Gemmell <robbie@apache.org>2012-02-25 20:57:51 +0000
commitda991619a0cd45c82920ec64a2acac98ba6a90a7 (patch)
tree47ee498b6cb8a6f541291c32e3e816e079683c2a /java/genpom
parent909ce302b0d4416152e7897860954a7d1f66d1e9 (diff)
downloadqpid-python-da991619a0cd45c82920ec64a2acac98ba6a90a7.tar.gz
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
Diffstat (limited to 'java/genpom')
-rwxr-xr-xjava/genpom34
1 files changed, 27 insertions, 7 deletions
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:
<groupId>%s</groupId>
<artifactId>%s</artifactId>
<version>%s</version>
- <scope>%s</scope>
- </dependency>
-""" % (group, artifactId, version,
+ <scope>%s</scope>""" % (group, artifactId, version,
scopes.get(artifactId, "compile")))
+ exclusions = lookupElement(dep, "exclusions")
+ if exclusions is not None:
+ deps.append("""
+ <exclusions>""")
+ for exclusion in list(exclusions.query["exclusion"]):
+ group = lookup(exclusion, "groupId")
+ artifactId = lookup(exclusion, "artifactId")
+ deps.append("""
+ <exclusion>
+ <groupId>%s</groupId>
+ <artifactId>%s</artifactId>
+ </exclusion>""" % (group, artifactId))
+ deps.append("""
+ </exclusions>""")
+
+ deps.append("""
+ </dependency>
+""")
+
TEMPLATE = """<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"