Skip to content

Commit 6d143df

Browse files
committed
checking maven version with mvn -version. Also, added two dependencies to fix dependency resolution in ocvn and famille-ba-sak
1 parent c0cd319 commit 6d143df

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

jdk_17_maven/cs/rest/familie-ba-sak/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@
392392
<id>github</id>
393393
<url>https://maven.pkg.github.com/navikt/familie-felles</url>
394394
</repository>
395+
<repository>
396+
<id>familie</id>
397+
<url>https://github-package-registry-mirror.gc.nav.no/cached/maven-release</url>
398+
</repository>
395399
</repositories>
396400

397401

jdk_8_maven/cs/rest-gui/ocvn/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@
8484
<enabled>true</enabled>
8585
</snapshots>
8686
</repository>
87+
<repository>
88+
<id>maven.restlet.org</id>
89+
<name>maven.restlet.org</name>
90+
<url>https://maven.restlet.talend.com</url>
91+
</repository>
8792
</repositories>
8893

8994
<pluginRepositories>

scripts/dist.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,24 @@ def checkMavenVersion():
2929
match = re.search(MAVEN_VERSION_REGEX, mvn_path)
3030
if match == None:
3131
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)
32+
33+
# use mcn -v
34+
print("\nTrying 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("\nVersion could not be retrieved with mvn -v command")
42+
43+
# might happen depending on installation path... instead of crashing immediately,
44+
# we try to build, as it might be the correct version... if not, it will fail anyway
45+
# TODO ideally, should rather use "mvn -v" to determine the version number...
46+
# although it would be bit tricky to implement (so not super important)
47+
return True
48+
49+
# exit(1)
3850

3951
mvn_txt = match.group()
4052
mvn_version = mvn_txt.split(".")

0 commit comments

Comments
 (0)