slachiewicz opened a new issue, #1813:
URL: https://github.com/apache/maven-dependency-plugin/issues/1813
The `get-classpath` IT fails on Maven 3.9.16, the line the plugin's
`<prerequisites>` (3.9.0) allows. CI runs only Maven 3.10 and 4, so it does not
show up there.
```text
java.lang.AssertionError: Unexpected classpath:
get-classpath-lib-1.0.jar:get-classpath-lib-dep-1.0.jar:get-classpath-lib-leaf-1.0.jar:get-classpath-lib-runtime-1.0.jar,
expected:
get-classpath-lib-1.0.jar:get-classpath-lib-dep-1.0.jar:get-classpath-lib-runtime-1.0.jar:get-classpath-lib-leaf-1.0.jar
for Apache Maven 3.9.16
```
(local repository paths shortened)
The goal is right and the expectation is not. `verify.groovy` says the
artifact is resolved "as for a project that depends on it, in the order of the
running Maven's resolver". On Maven 3.9.16, a project that declares
`get-classpath-lib:1.0` as its only dependency gets the same order the goal
printed:
```text
$ mvn dependency:build-classpath # Maven 3.9.16, get-classpath-lib-system
excluded
get-classpath-lib-1.0.jar
get-classpath-lib-dep-1.0.jar
get-classpath-lib-leaf-1.0.jar
get-classpath-lib-runtime-1.0.jar
```
So Maven 3.9 places the transitive `leaf` (via `dep`) before the direct
`runtime` dependency, and Maven 3.10 and 4 place it after. The script already
branches on the Maven version for the leaf version (2.0 on Maven 4, through the
artifact's `dependencyManagement`); the expected order needs the same treatment.
Proposed fix: build `expected` per Maven version in
`src/it/projects/get-classpath/verify.groovy`, with `leaf` before `runtime` for
Maven 3.9.x. Comparing the entries as a set would hide the order, which is part
of what the goal promises.
Reproduce: `mvn -P run-its verify -Dinvoker.test=get-classpath` with Maven
3.9.16.
--
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]