def main(): """Test driver that prints out dependencies. Run from ~/Development/java """ source_file_name = "service/exemplar/pom.xml" df = CachedDependencyInfos.get(source_file_name) deps = df.dependencies print "dependencies of artifact {groupId}.{artifactId}".format(groupId=df.groupId, artifactId=df.artifactId) for dep in deps: print(" groupId.artifactId: {groupId}.{artifactId}".format(groupId=dep['groupId'], artifactId=dep['artifactId']))
def build_dependency_graph(): dependency_edges = {} for module in PomUtils.top_pom_content_handler().modules: logger.debug("found module: " + module) finder = CachedDependencyInfos.get(module + "/pom.xml") deps = finder.dependencies target = "{group_id}.{artifact_id}".format(group_id=finder.groupId, artifact_id=finder.artifactId) logger.debug("Adding dependencies for {target}".format(target=target)) dependency_edges[target] = [] for dep in deps: dep_target = "{group_id}.{artifact_id}".format(group_id=dep['groupId'], artifact_id=dep['artifactId']) logger.debug("{target} => {dep_target}".format(target=target, dep_target=dep_target)) dependency_edges[target].append(dep_target) return dependency_edges
def build_dependency_graph(): dependency_edges = {} for module in PomUtils.top_pom_content_handler().modules: logger.debug("found module: " + module) finder = CachedDependencyInfos.get(module + "/pom.xml") deps = finder.dependencies target = "{group_id}.{artifact_id}".format( group_id=finder.groupId, artifact_id=finder.artifactId) logger.debug("Adding dependencies for {target}".format(target=target)) dependency_edges[target] = [] for dep in deps: dep_target = "{group_id}.{artifact_id}".format( group_id=dep['groupId'], artifact_id=dep['artifactId']) logger.debug("{target} => {dep_target}".format( target=target, dep_target=dep_target)) dependency_edges[target].append(dep_target) return dependency_edges