This is an automated email from the ASF dual-hosted git repository.
cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new 23d38a2d90 Proper isolation of maven-executor UTs (#11392)
23d38a2d90 is described below
commit 23d38a2d9088e0fb331c9071e55456d6e9e5b0b1
Author: Tamas Cservenak <[email protected]>
AuthorDate: Wed Nov 5 15:15:18 2025 +0100
Proper isolation of maven-executor UTs (#11392)
They lacked in some cases the `.mvn` directory, and it caused
Maven to "bubble up" all way to Maven Project own `.mvn`.
Now the UT properly confine the test within CWD by creating
`.mvn` in it.
---
.../java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java | 3 +--
.../java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git
a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java
b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java
index eb672c71e4..028efb029d 100644
---
a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java
+++
b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/MavenExecutorTestSupport.java
@@ -56,7 +56,7 @@ public abstract class MavenExecutorTestSupport {
@BeforeEach
void beforeEach(TestInfo testInfo) throws Exception {
cwd =
tempDir.resolve(testInfo.getTestMethod().orElseThrow().getName()).resolve("cwd");
- Files.createDirectories(cwd);
+ Files.createDirectories(cwd.resolve(".mvn"));
userHome =
tempDir.resolve(testInfo.getTestMethod().orElseThrow().getName())
.resolve("home");
Files.createDirectories(userHome);
@@ -380,7 +380,6 @@ private ExecutorRequest.Builder
customize(ExecutorRequest.Builder builder) {
}
protected void layDownFiles(Path cwd) throws IOException {
- Files.createDirectory(cwd.resolve(".mvn"));
Path pom = cwd.resolve("pom.xml").toAbsolutePath();
Files.writeString(pom, POM_STRING);
Path appJava =
cwd.resolve("src/main/java/org/apache/maven/samples/sample/App.java");
diff --git
a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java
b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java
index 79d1745c3b..8152f2a790 100644
---
a/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java
+++
b/impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java
@@ -60,7 +60,7 @@ void beforeEach(TestInfo testInfo) throws Exception {
String testName = testInfo.getTestMethod().orElseThrow().getName();
userHome = tempDir.resolve(testName);
cwd = userHome.resolve("cwd");
- Files.createDirectories(cwd);
+ Files.createDirectories(cwd.resolve(".mvn"));
if (MimirInfuser.isMimirPresentUW()) {
if (testName.contains("3")) {