mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
Add tests for Maven wrapper
This commit is contained in:
12
java/integration-tests-lib/maven_wrapper_test_utils.py
Normal file
12
java/integration-tests-lib/maven_wrapper_test_utils.py
Normal 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)
|
||||
Reference in New Issue
Block a user