From c357ab6c48d3b4a1fadf36901e321300c42b81ae Mon Sep 17 00:00:00 2001 From: Li Date: Wed, 15 Mar 2017 22:44:13 +0800 Subject: [PATCH] #529 Add comment on the new function and refine the code --- src/packagedcode/maven.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/packagedcode/maven.py b/src/packagedcode/maven.py index 5d0aab7aa9b..8f7364a3555 100644 --- a/src/packagedcode/maven.py +++ b/src/packagedcode/maven.py @@ -493,6 +493,12 @@ def pom_version(location): def replace_variables_in_pom(variable, pom): + """ + Return the mapped variable value from the passed pom dictionary. + The passing variable could be '${project.artifactId}', and it would be + mapped to maven_component_artifact_id first, and then search by key-value + from the dictionary pom. + """ if not variable: return variable mapped_key = MAVEN_VARIABLES_MAP.get(variable) @@ -536,8 +542,8 @@ def parse_pom(location, fields=MAVEN_FIELDS): except Exception, e: msg = ('Failed error:\n%(e)r' % locals()) logger.debug(' resolve_dependency: ' + msg) - pom['maven_dependencies'] = maven_dependencies + return pom