Skip to content

Compute local repository and artifact paths without a plugin - #65

Closed
slachiewicz wants to merge 1 commit into
mainfrom
agent/default-executor-tool
Closed

slachiewicz wants to merge 1 commit into
mainfrom
agent/default-executor-tool

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

The only ExecutorTool, ToolboxExecutorTool, answers localRepository(), artifactPath() and metadataPath() by running eu.maveniverse.maven.plugins:toolbox through the Maven under test, so every consumer that needs an artifact path resolves a non-ASF plugin into its test local repository (#44). This is A7 in #49, and the base that the planned test-support module (T1) builds verifyArtifact* and deleteArtifacts on.

DefaultExecutorTool computes the same answers without running Maven:

  • Local repository, in order: a -Dmaven.repo.local= argument of the request (the last one wins, also as -D maven.repo.local=…), the same in .mvn/maven.config, the request's maven.repo.local JVM system property, this JVM's maven.repo.local, <localRepository> of the user settings (-s/--settings, else ~/.m2/settings.xml, with ${user.home}, ${env.X} and system properties interpolated), of the global settings (-gs, else conf/settings.xml when the tool is given the installation), and finally ~/.m2/repository of the request's user home. A relative path is resolved against the request's working directory.
  • Paths, relative to the local repository like the toolbox ones, in the default layout of Resolver's enhanced local repository manager: G:A[:E[:C]]:V artifacts, including the base-version directory of timestamped snapshots, and [G]:[A]:[V]:[type] metadata with -local or -<repositoryId> inserted into the file name.
  • dump() needs the Maven under test, so it throws; ToolboxExecutorTool stays for that and as the authoritative provider when a split repository, a custom layout or settings profiles matter. The class Javadoc says so.

Tests:

  • DefaultExecutorToolTest: 12 unit tests for the lookup order and the layout, no Maven needed.
  • DefaultExecutorToolMatchesToolboxTest: runs both tools on Maven 3 and Maven 4 and asserts the same local repository, artifact paths (jar, pom, classifier, snapshot, timestamped snapshot, each installed and from a remote) and metadata paths (group, artifact, version level, local and remote). It caught one difference while writing this: an installed timestamped snapshot is named after its base version, a downloaded one keeps the timestamp.
  • mvn verify passes for the whole reactor.

module-info gains requires java.xml for reading settings. The class is @since 1.1.0, the target #49 gives A7.

Closes #44

🤖 Generated with Claude Code

ToolboxExecutorTool answers localRepository(), artifactPath() and
metadataPath() by running a non-ASF plugin through the Maven under test,
which resolves that plugin into the local repository under test.
DefaultExecutorTool computes the same answers from the request: the
maven.repo.local argument, .mvn/maven.config, the system property,
user and global settings, then ~/.m2/repository, and the default layout
for the paths. ToolboxExecutorTool stays for dump() and as the
authoritative provider.

Closes #44

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

ExecutorTool resolves a non-ASF plugin into the test local repository

1 participant