Skip to content

Commit c291d9d

Browse files
authored
Merge pull request #22855 from github/fix-maven-empty-home-rc-3.23
[rc/3.23] Java: isolate Maven integration test repositories
2 parents c27d476 + 15ed706 commit c291d9d

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

  • java/ql/integration-tests/java
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import os
22
import os.path
33

4-
def test(codeql, java, check_diagnostics_java):
4+
def test(codeql, java, check_diagnostics_java, tmp_path):
55
codeql.database.create(build_mode = "none",
66
_env={
7-
"_JAVA_OPTIONS": "-Duser.home=" + os.path.join(os.getcwd(), "home-dir-with-maven-settings")
7+
"_JAVA_OPTIONS": " ".join([
8+
"-Duser.home=" + os.path.join(os.getcwd(), "home-dir-with-maven-settings"),
9+
"-Dmaven.repo.local=" + str(tmp_path / "maven-repository")
10+
])
811
}
912
)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import os
22
import os.path
33

4-
def test(codeql, java, check_diagnostics_java):
4+
def test(codeql, java, check_diagnostics_java, tmp_path):
55
codeql.database.create(build_mode = "none",
66
_env={
7-
"_JAVA_OPTIONS": "-Duser.home=" + os.path.join(os.getcwd(), "empty-home"),
7+
"_JAVA_OPTIONS": " ".join([
8+
"-Duser.home=" + os.path.join(os.getcwd(), "empty-home"),
9+
"-Dmaven.repo.local=" + str(tmp_path / "maven-repository")
10+
]),
811
"LGTM_INDEX_MAVEN_SETTINGS_FILE": os.path.join(os.path.dirname(os.path.realpath(__file__)), "settings.xml")
912
}
1013
)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import os
22
import os.path
33

4-
def test(codeql, java, check_diagnostics_java):
4+
def test(codeql, java, check_diagnostics_java, tmp_path):
55
codeql.database.create(build_mode = "none",
66
_env={
7-
"_JAVA_OPTIONS": "-Duser.home=" + os.path.join(os.getcwd(), "empty-home")
7+
"_JAVA_OPTIONS": " ".join([
8+
"-Duser.home=" + os.path.join(os.getcwd(), "empty-home"),
9+
"-Dmaven.repo.local=" + str(tmp_path / "maven-repository")
10+
])
811
}
912
)

0 commit comments

Comments
 (0)