Skip to content

Add maven-executor-verifier, a Verifier on top of the executors - #66

Closed
slachiewicz wants to merge 2 commits into
agent/default-executor-toolfrom
agent/executor-verifier
Closed

slachiewicz wants to merge 2 commits into
agent/default-executor-toolfrom
agent/executor-verifier

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Stacked on #65 (A7, plugin-free paths): this PR targets its branch, so the diff shows only the new module; it retargets to main once #65 is merged.

Seven IT suites that moved off maven-verifier (sources table in #49) each wrote about 2,100 lines of the same Verifier helpers, and review of apache/maven-integration-testing#446 asked for them in one place instead. This is T1 in #49: a maven-executor-verifier module, Java 8, depending on maven-executor only.

Verifier, seeded from apache/maven-integration-testing#446:

  • execute() runs Maven in the base directory with -e --batch-mode, -Dmaven.repo.local, maven-clean-plugin:clean first unless setAutoclean(false), the system properties as -D and then the arguments; stdout and stderr go to the log file (log.txt, setLogFileName). A non-zero exit throws VerificationException with the command line and the log.
  • Maven is the installation in maven.home, in the mode of verifier.forkMode (forked when unset), with one shared ExecutorHelper per installation for the life of the JVM; or any ExecutorHelper given to the constructor.
  • Log checks: verifyErrorFreeLog (an [ERROR] scan that ignores old Doxia's Velocity noise), verifyTextInLog, and the new verifyTextNotInLog, all ignoring ANSI colours.
  • File checks: verifyFilePresent/NotPresent with * patterns and a.jar!/entry; loadLines, loadProperties, loadFile with ${artifact:…} markers, filterFile, newDefaultFilterMap.
  • Local repository: getLocalRepository, getArtifactPath, getArtifactMetadataPath, verifyArtifact*, deleteArtifact(s). Paths come from an ExecutorTool, DefaultExecutorTool from Compute local repository and artifact paths without a plugin #65 by default, so no plugin is resolved. Packaging types that are stored under another extension (maven-plugin, test-jar, ejb-client, …) are mapped; a suite adds its own by overriding extensionAndClassifier (the core ITs' coreit-artifact, for example).
  • addCliArgument adds one argument as is; the new addCliOption("-pl x -am") splits on whitespace like maven-verifier 1.x. Replace maven-verifier with an in-repo Verifier on maven-executor maven-build-cache-extension#536 failed on exactly that.

Left out on purpose, per review of #446: the members kept there only for source compatibility with maven-verifier: Verifier(String, boolean), displayStreamBuffers(), setCliOptions(List), filterFile(…, Properties), getLocalRepoLayout() and the USER_HOME constants. Consumers migrate those call sites. maven-shared-utils is replaced by the JDK.

ResourceExtractor: same API, without maven-shared-utils. It fixes a bug in the seed: the ZipFile was closed inside the loop after the first file, so extracting a test project with more than one file from a jar failed. A relative resource path now resolves against the class's package, and a jar entry can't escape the target directory.

Behaviour differences from the seed: verifyArtifactNotPresent checks the artifact file only (the seed also failed when metadata next to it existed), and ${artifact:…} markers list the metadata of the version and artifact directories for lines with and without a command alike.

Tests (all pass; mvn verify passes for the reactor):

  • VerifierTest: 9 tests without running Maven: argument splitting, local repository lookup, artifact and metadata paths, a suite type through the override, artifact checks and deletion, log checks with ANSI and Velocity lines, file and jar-entry checks, filtering, ${artifact:} markers.
  • ResourceExtractorTest: a directory with several files extracted from a jar (fails on the seed), and a class-path directory used in place or copied.
  • VerifierExecuteTest: forked and embedded Maven 3 and Maven 4 (4.0.0-rc-7): install then artifact checks; addCliOption("-pl b -am validate") builds a and b but not c; a failing build throws and leaves its log.

Not in this PR: T2 (the JUnit 5 extension) and A3 (Builder.logFile). The module version follows the reactor, and #49 places T1 in 2.x.

Part of #49

🤖 Generated with Claude Code

Seven IT suites that moved off maven-verifier each wrote about 2,100 lines
of the same Verifier helpers. This module holds them once: running Maven
with -e --batch-mode, autoclean and the log file, the log, file and
artifact checks, filtering, and ResourceExtractor. It is seeded from
apache/maven-integration-testing#446 without the members kept there only
for source compatibility with maven-verifier, depends on maven-executor
only, and computes paths through DefaultExecutorTool. addCliOption()
splits an option such as "-pl x -am" into separate arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rc-6 deadlock behind E1 is fixed in 4.0.0-rc-7, which the build uses;
all three scenarios pass embedded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slachiewicz slachiewicz added the wontfix This will not be worked on label Oct 7, 2026
@slachiewicz slachiewicz closed this Oct 7, 2026
@slachiewicz
slachiewicz deleted the agent/executor-verifier branch October 7, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant