|
5 | 5 | import xml.etree.ElementTree as ET
|
6 | 6 |
|
7 | 7 | XPATH_ARTIFACT_ID = "./mvn:artifactId"
|
| 8 | +XPATH_GROUP_ID = "./mvn:groupId" |
| 9 | +XPATH_PARENT_GROUP_ID = "./mvn:parent/mvn:groupId" |
8 | 10 | XPATH_DESCRIPTION = "./mvn:description"
|
9 | 11 | XPATH_SUBMODULES = "./mvn:modules/mvn:module"
|
10 | 12 | MAVEN_NAMESPACE = {'mvn': 'http://maven.apache.org/POM/4.0.0'}
|
@@ -40,9 +42,14 @@ def generate_entry(indent, project_folder):
|
40 | 42 | padding = ('{:' + str(indent * 2) + '}').format(' ')
|
41 | 43 |
|
42 | 44 | artifact = pom.find(XPATH_ARTIFACT_ID, namespaces=MAVEN_NAMESPACE)
|
| 45 | + group = pom.find(XPATH_GROUP_ID, namespaces=MAVEN_NAMESPACE) |
| 46 | + parentGroup = pom.find(XPATH_PARENT_GROUP_ID, namespaces=MAVEN_NAMESPACE) |
43 | 47 | description = pom.find(XPATH_DESCRIPTION, namespaces=MAVEN_NAMESPACE)
|
44 | 48 |
|
45 |
| - print('{}* **{}**: {}'.format(padding, artifact.text, description.text)) |
| 49 | + if group is not None: |
| 50 | + print('{}* **{}**:**{}**: {}'.format(padding, group.text, artifact.text, description.text)) |
| 51 | + else: |
| 52 | + print('{}* **{}**:**{}**: {}'.format(padding, parentGroup.text, artifact.text, description.text)) |
46 | 53 |
|
47 | 54 | for module in pom.findall(XPATH_SUBMODULES, namespaces=MAVEN_NAMESPACE):
|
48 | 55 | generate_entry(indent + 1, os.path.join(project_folder, module.text))
|
|
0 commit comments