arturobernalg opened a new pull request, #1179:
URL: https://github.com/apache/maven-compiler-plugin/pull/1179
Fixes #1124.
`DependencyState.modificationState()` branched on `Files.isDirectory()`,
which is also false for a path that does not exist at all. A reactor module
with no main sources never creates `target/classes`, but that path is still on
the test classpath, so `testCompile` tried to read it as a single file, got a
`NoSuchFileException`, and logged a spurious "I/O error reading dependency
state" warning on every build. This is a regression introduced by #1102 in
3.16.0; confirmed still reproducing on maven-3.10.x per cstamas's comment on
the issue.
Checking `Files.notExists()` first and treating a missing path like an empty
directory removes the warning and keeps the recorded state stable across builds
instead of recording "unreadable" from the caught exception.
New test
`treatsMissingDependencyDirectoryAsEmptyWithoutWarningOrForcedRebuild` fails on
the old code (catches the spurious `log.warn("I/O error...")` call) and passes
with the fix. Ran the full test suite, checkstyle:check and spotless:check
locally, all green.
Claude-Session: https://claude.ai/code/session_01WUpJGfMpe1TZMx18K9zF4M
---
To make clear that you license your contribution under
the [Apache License Version 2.0, January
2004](https://www.apache.org/licenses/LICENSE-2.0)
check one of the following:
- [x] I hereby declare this contribution to be licensed under the [Apache
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
- [x] I hereby declare that I have filed an [Apache Individual Contributor
License Agreement](https://www.apache.org/licenses/icla.pdf).
--
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]