Skip to content

Commit 059731a

Browse files
authored
Tidy up executor UTs (#11249)
Tidy up executor UTs as they are problematic. Output as much as possible as Maven in this case is used in quiet mode. Also update Toolbox version and centralize it (one exception: tool deprecated and unused ctor).
1 parent c7241dd commit 059731a

File tree

12 files changed

+226
-210
lines changed

12 files changed

+226
-210
lines changed

impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvn/MavenInvokerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,11 @@ void conflictingSettings(
218218
Map<String, String> logs = invoke(
219219
cwd,
220220
userHome,
221-
List.of("eu.maveniverse.maven.plugins:toolbox:0.7.4:help"),
221+
List.of("eu.maveniverse.maven.plugins:toolbox:" + System.getProperty("version.toolbox") + ":help"),
222222
List.of("--force-interactive"));
223223

224-
String log = logs.get("eu.maveniverse.maven.plugins:toolbox:0.7.4:help");
224+
String log =
225+
logs.get("eu.maveniverse.maven.plugins:toolbox:" + System.getProperty("version.toolbox") + ":help");
225226
assertTrue(log.contains("https://repo1.maven.org/maven2"), log);
226227
assertFalse(log.contains("https://repo.maven.apache.org/maven2"), log);
227228
}

impl/maven-executor/pom.xml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ under the License.
3232
<description>Maven 4 Executor, for executing Maven 3/4.</description>
3333

3434
<properties>
35-
<maven3version>3.9.9</maven3version>
35+
<maven3version>3.9.11</maven3version>
3636
<maven4version>${project.version}</maven4version>
37+
<testTmpDir>${project.build.directory}/tmp</testTmpDir>
3738
</properties>
3839

3940
<dependencies>
@@ -110,6 +111,24 @@ under the License.
110111
</execution>
111112
</executions>
112113
</plugin>
114+
<plugin>
115+
<groupId>org.apache.maven.plugins</groupId>
116+
<artifactId>maven-antrun-plugin</artifactId>
117+
<executions>
118+
<execution>
119+
<id>create-tmp-dir</id>
120+
<goals>
121+
<goal>run</goal>
122+
</goals>
123+
<phase>process-test-resources</phase>
124+
<configuration>
125+
<target>
126+
<mkdir dir="${testTmpDir}" />
127+
</target>
128+
</configuration>
129+
</execution>
130+
</executions>
131+
</plugin>
113132
<plugin>
114133
<groupId>org.apache.maven.plugins</groupId>
115134
<artifactId>maven-surefire-plugin</artifactId>
@@ -122,6 +141,7 @@ under the License.
122141
<maven4home>${project.build.directory}/dependency/apache-maven-${maven4version}</maven4home>
123142
<localRepository>${settings.localRepository}</localRepository>
124143
</systemPropertyVariables>
144+
<argLine>-Xmx256m @{jacocoArgLine} -Djava.io.tmpdir=${testTmpDir}</argLine>
125145
</configuration>
126146
</plugin>
127147
</plugins>

impl/maven-executor/src/main/java/org/apache/maven/cling/executor/internal/ToolboxTool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ public class ToolboxTool implements ExecutorTool {
4747
private final ExecutorHelper.Mode forceMode;
4848

4949
/**
50-
* @deprecated Better specify required version yourself. This one is "cemented" to 0.7.4
50+
* @deprecated Better specify required version yourself. This one is "cemented" to 0.13.7
5151
*/
5252
@Deprecated
5353
public ToolboxTool(ExecutorHelper helper) {
54-
this(helper, "0.7.4");
54+
this(helper, "0.13.7");
5555
}
5656

5757
public ToolboxTool(ExecutorHelper helper, String toolboxVersion) {

0 commit comments

Comments
 (0)