Skip to content

Commit 7bd102b

Browse files
cklinCopilot
andcommitted
Java: isolate Maven integration test repositories
Maven 3.10 writes resolver-status.properties into the local repository. Keep generated repository state outside the test source root so source archive expectations remain stable across Maven versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 62d8f126-ba11-4727-bf0a-1785b8bb21b7
1 parent 8436a8b commit 7bd102b

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)