slachiewicz commented on PR #827:
URL:
https://github.com/apache/maven-shade-plugin/pull/827#issuecomment-5400926404
The red cell is this PR's own IT, not the change under test. `windows-latest
jdk-8-zulu` is the only failing cell; the other 17 are green, and the invoker
summary is `Passed: 83, Failed: 1` with `MSHADE-434_ratSideEffect\pom.xml` as
the one failure.
`verify.groovy` looks for the `help:evaluate` output like this:
```groovy
def projectFileLine = lines.find { it =~ /^\// && it.endsWith("/pom.xml") }
assert projectFileLine != null
```
Both predicates assume a Unix path. On Windows the value is
`D:\a\maven-shade-plugin\...\pom.xml`, which neither starts with `/` nor ends
with `/pom.xml`, so `find` returns null and the assert fires before anything
about `project.file` is actually checked:
'/home/runner/work/p/pom.xml' -> found = true
'D:\a\...\pom.xml' -> found = false
Matching on the file name instead of the separator fixes it —
`it.trim().endsWith("pom.xml") &&
!it.trim().endsWith("dependency-reduced-pom.xml")` — or compare against `new
File(basedir, "pom.xml").canonicalPath`, which is separator-correct by
construction.
#828 carries the identical matcher and fails on the same single cell, so one
fix covers both.
## On the overlap
#128, this PR, and #828 all address the same thing:
`dependencyReducedPomLocation` leaving `project.getFile()` pointing at the
reduced POM. #128 changes `setFile` to `setPomFile` so `basedir` is never
reassigned; these two save the original and restore it afterwards. Both work,
but they are alternatives rather than complements, and #128 has been approved
and open since 2022. Worth a maintainer deciding which one lands before either
is merged.
*This comment was created with AI assistance.*
--
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]