@@ -29,12 +29,18 @@ def checkMavenVersion():
2929 match = re .search (MAVEN_VERSION_REGEX , mvn_path )
3030 if match == None :
3131 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)
32+
33+ # use mcn -v
34+ print ("\n Trying mvn -v to retrieve the version" )
35+
36+ version_res = run ([mvn_path , "-v" ], capture_output = True , text = True )
37+ result_out = version_res .stdout .strip ()
38+ match = re .search (MAVEN_VERSION_REGEX , result_out )
39+
40+ if match == None :
41+ print ("\n Version could not be retrieved with mvn -v command as well" )
42+ # might happen depending on installation path... instead of crashing immediately,
43+ return True
3844
3945 mvn_txt = match .group ()
4046 mvn_version = mvn_txt .split ("." )
@@ -238,6 +244,9 @@ def build_jdk_11_gradle():
238244 command = "gradlew"
239245
240246 if platform .system () == "Darwin" :
247+ # make sure gradlew command is executable
248+ os .system ("chmod +x " + os .getcwd () + "/" + folder + "/gradlew" )
249+
241250 command = "./gradlew"
242251
243252 gradleres = run ([command , "build" , "-x" , "test" ], shell = SHELL , cwd = os .path .join (PROJ_LOCATION , folder ),
@@ -263,6 +272,10 @@ def build_jdk_17_gradle():
263272 command = "gradlew"
264273
265274 if platform .system () == "Darwin" :
275+
276+ # make sure gradlew command is executable
277+ os .system ("chmod +x " + os .getcwd () + "/" + folder + "/gradlew" )
278+
266279 command = "./gradlew"
267280
268281 gradleres = run ([command , "build" , "-x" , "test" ], shell = SHELL , cwd = os .path .join (PROJ_LOCATION , folder ),
0 commit comments