diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2012-05-04 15:39:19 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2012-05-04 15:39:19 +0000 |
| commit | 633c33f224f3196f3f9bd80bd2e418d8143fea06 (patch) | |
| tree | 1391da89470593209466df68c0b40b89c14963b1 /java/genpom | |
| parent | c73f9286ebff93a6c8dbc29cf05e258c4b55c976 (diff) | |
| download | qpid-python-633c33f224f3196f3f9bd80bd2e418d8143fea06.tar.gz | |
QPID-3858: Updated branch - merged from trunk r.1333987
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1334037 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/genpom')
| -rwxr-xr-x | java/genpom | 34 |
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" |
