elharo opened a new pull request, #408:
URL: https://github.com/apache/maven-help-plugin/pull/408
## Summary
Fixes apache/maven-help-plugin#406.
The `evaluate-artifact-with-expression-with-output` IT was flaky on CI
(while usually passing locally). The IT ran the `evaluate` goal with
`artifact=org.apache.maven.plugins:maven-help-plugin` (no version). The
`artifact` parameter treats a missing version as `LATEST`, which the plugin
resolves by fetching `maven-metadata.xml` and the plugin POM from remote
repositories (Maven Central through the mock repository manager proxy).
This made the IT depend on:
- network access to Maven Central at test time (transiently slow/unavailable
on CI),
- whatever the "latest" released version is at that moment (a floating,
non-hermetic input).
## Change
Pinned the artifact to the plugin version under test by configuring it in
the IT's (invoker-filtered) POM:
```xml
<configuration>
<artifact>org.apache.maven.plugins:maven-help-plugin:@project.version@</artifact>
</configuration>
```
`@project.version@` is filtered to the locally built version (e.g.
`3.5.3-SNAPSHOT`), which the invoker `install` goal already places into the IT
local repository. The fake project is therefore built from the local plugin
POM: no `LATEST` metadata resolution, no Central downloads, and the evaluated
`project.name` stays `Apache Maven Help Plugin` as asserted by `verify.groovy`.
Removed the now-redundant `artifact` line from `test.properties`.
The test still exercises exactly what it is meant to verify (the `artifact`
parameter builds a fake project and evaluates expressions against it while
`session.currentProject` remains the real project, per the enforcer rule /
MPH-114).
## Verification
- `mvn -Prun-its
-Dinvoker.test=evaluate-artifact-with-expression-with-output verify`: passes;
build.log shows `Skipped remote request for
...:3.5.3-SNAPSHOT/maven-metadata.xml locally installed metadata up-to-date`,
i.e. no remote access.
- Full `mvn -Prun-its verify`: BUILD SUCCESS, 33 ITs passed (2 skipped,
unchanged), 26 unit tests pass.
Note: the sibling ITs `effective-pom-artifact` and
`effective-pom-multimodule-artifact` use the same floating `artifact =
org.apache.maven.plugins:maven-help-plugin` pattern and are latent flaky; left
unchanged here to keep this PR focused.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]