Add tests for Maven wrapper

This commit is contained in:
Chris Smowton
2024-02-16 21:02:09 +00:00
parent 408a550467
commit 03f01a0121
42 changed files with 2295 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import sys
import os.path
def check_maven_wrapper_exists(expected_version):
if not os.path.exists(".mvn/wrapper/maven-wrapper.jar"):
print("Maven wrapper jar file expected but not found", file = sys.stderr)
sys.exit(1)
with open(".mvn/wrapper/maven-wrapper.properties", "r") as f:
content = f.read()
if ("apache-maven-%s-" % expected_version) not in content:
print("Expected Maven wrapper to fetch version %s, but actual properties file said:\n\n%s" % (expected_version, content), file = sys.stderr)
sys.exit(1)