Skip to content

Commit 150a941

Browse files
committed
Merge branch 'develop' into mongo-support
2 parents 182c997 + c2ff43d commit 150a941

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

scripts/dist.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,26 @@
2121

2222

2323
def checkMavenVersion():
24-
mvn_txt = re.search(MAVEN_VERSION_REGEX, shutil.which("mvn")).group()
25-
mvn_version = mvn_txt.split(".")
26-
if len(mvn_version) != 3:
27-
print("\nERROR: Cannot find maven with `which mvn`:" + mvn_txt)
24+
mvn_path = shutil.which("mvn")
25+
if mvn_path == None:
26+
print("\nERROR: Cannot find maven with `which mvn`")
2827
exit(1)
28+
29+
match = re.search(MAVEN_VERSION_REGEX, mvn_path)
30+
if match == None:
31+
print("\nCannot determine mvn version from its path location: " + mvn_path)
32+
# might happen depending on installation path... instead of crashing immediately,
33+
# we try to build, as it might be the correct version... if not, it will fail anyway
34+
# TODO ideally, should rather use "mvn -v" to determine the version number...
35+
# although it would be bit tricky to implement (so not super important)
36+
return True
37+
# exit(1)
38+
39+
mvn_txt = match.group()
40+
mvn_version = mvn_txt.split(".")
41+
42+
print("\nDetected mvn version based on its path location: " + mvn_txt)
43+
2944
above = MAVEN_VERSION_ABOVE.split(".")
3045
for index, v in enumerate(mvn_version):
3146
if int(above[index]) > int(v):

0 commit comments

Comments
 (0)