verify that each POM's coordinate (drawn from its content) matches its filepath, and verify that the corresponding artifact exists.
(artifacts, version)
| 945 | |
| 946 | |
| 947 | def verifyDeployedPOMsCoordinates(artifacts, version): |
| 948 | """ |
| 949 | verify that each POM's coordinate (drawn from its content) matches |
| 950 | its filepath, and verify that the corresponding artifact exists. |
| 951 | """ |
| 952 | print(" verify deployed POMs' coordinates...") |
| 953 | if 'SNAPSHOT' in version: |
| 954 | print(" (skipping filepath check for SNAPSHOT — timestamp paths differ from coordinate)") |
| 955 | return |
| 956 | for POM in [a for a in artifacts if a.endswith('.pom')]: |
| 957 | treeRoot = ET.parse(POM).getroot() |
| 958 | groupId, artifactId, packaging, POMversion = getPOMcoordinate(treeRoot) |
| 959 | POMpath = '%s/%s/%s/%s-%s.pom' \ |
| 960 | % (groupId.replace('.', '/'), artifactId, version, artifactId, version) |
| 961 | if not POM.endswith(POMpath): |
| 962 | raise RuntimeError("Mismatch between POM coordinate %s:%s:%s and filepath: %s" |
| 963 | % (groupId, artifactId, POMversion, POM)) |
| 964 | # Verify that the corresponding artifact exists |
| 965 | artifact = POM[:-3] + packaging |
| 966 | if artifact not in artifacts: |
| 967 | raise RuntimeError('Missing corresponding .%s artifact for POM %s' % (packaging, POM)) |
| 968 | |
| 969 | |
| 970 | def crawl(downloadedFiles, urlString, targetDir, exclusions=set()): |
no test coverage detected
searching dependent graphs…