File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222
2323def 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 ("\n ERROR: Cannot find maven with `which mvn`:" + mvn_txt )
24+ mvn_path = shutil .which ("mvn" )
25+ if mvn_path == None :
26+ print ("\n ERROR: 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 ("\n Cannot 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 ("\n Detected 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 ):
You can’t perform that action at this time.
0 commit comments