@@ -0,0 +1,2349 @@
+#!/usr/bin/env python%0A################################################################################%0A# Licensed to the Apache Software Foundation (ASF) under one%0A# or more contributor license agreements.  See the NOTICE file%0A# distributed with this work for additional information%0A# regarding copyright ownership.  The ASF licenses this file%0A#  to you under the Apache License, Version 2.0 (the%0A#  %22License%22); you may not use this file except in compliance%0A#  with the License.  You may obtain a copy of the License at%0A#%0A#      http://www.apache.org/licenses/LICENSE-2.0%0A#%0A#  Unless required by applicable law or agreed to in writing, software%0A#  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A#  See the License for the specific language governing permissions and%0A# limitations under the License.%0A################################################################################%0Aimport xml.etree.ElementTree as ET%0Aimport os%0Aimport fnmatch%0Aimport sys%0A%0A# This lists all dependencies in the Maven Project root given as first%0A# argument. If a dependency is included in several versions it is listed once%0A# for every version. The resul output is sorted. So this can be used%0A# to get a diff between the Maven dependencies of two versions of a project.%0A%0Apath = sys.argv%5B1%5D%0A%0Apomfiles = %5Bos.path.join(dirpath, f)%0A    for dirpath, dirnames, files in os.walk(path)%0A    for f in fnmatch.filter(files, 'pom.xml')%5D%0A%0Adeps = set()%0A%0Afor pom in pomfiles:%0A%0A    root = ET.parse(pom).getroot()%0A%0A    for dep in root.iter('%7Bhttp://maven.apache.org/POM/4.0.0%7Ddependency'):%0A        groupId = dep.find(%22%7Bhttp://maven.apache.org/POM/4.0.0%7DgroupId%22).text%0A        artifactId = dep.find(%22%7Bhttp://maven.apache.org/POM/4.0.0%7DartifactId%22).text%0A        version = dep.find(%22%7Bhttp://maven.apache.org/POM/4.0.0%7Dversion%22)%0A        # if it has no version tag it must be in dependencyManagement somewhere, with%0A        # a version tag, so we already have it in our list%0A        if version != None:%0A            if %22flink%22 in groupId: continue%0A%0A            depstring = groupId + %22 %22 + artifactId + %22 %22 + version.text%0A            deps.add(depstring)%0A%0Adeplist = list(deps)%0Adeplist.sort()%0A%0Afor dep in deplist:%0A    print dep%0A%0A%0A%0A#for atype in e.findall('dependency'):%0A#    print(atype.get('foobar'))%0A

Add list_deps.py tool