Maven plugin: improve error message when target libs are not found.
Metadata
Current evaluation
Merged updates to the Maven plugin that enhance error reporting for missing target libraries. The change adds searched directories and a usage scenario to clarify build failures. Approved by one reviewer and passed CI checks.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Recently joined Canonical and tried to build a Snap out of a Java library. The error seemed a bit difficult to understand at first (have done mostly Gradle before so was not used to Maven).
I have then improved a bit the error message to explain that it could just that maven-targets declaration does not match the directory in which the Java library has been built. To help the user better understand what could be wrong the error message has been improved to add the directories in which the `arfiles` were searched and clarifying a simple scenario (the one that happened to me) that could lead to fix the situation.
What I think it would help even more is to replace to have the actual part name at this point so that we could `Could not find built jar files for part [the name of the part here] ...". But I did not knew how to get that, with some guidance I could that if that is of interest. I think it could help.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged updates to the Maven plugin that enhance error reporting for missing target libraries. The change adds searched directories and a usage scenario to clarify build failures. Approved by one reviewer and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Improved Maven plugin error message for missing target libraries by listing searched directories and clarifying build path mismatches. Contributor suggested adding the part name in future updates. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged an external contribution improving the Maven plugin error message for missing target libraries. The update clarifies common misconfigurations by listing searched directories and providing actionable troubleshooting steps. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1155 feat(maven-use): handle indirect plugin dependencies | craft-parts | merged | Merged changes fix Maven indirect plugin dependency handling by scanning available plugins on disk and adding explicit pins via pluginManagement, replacing hard-coded default versions. Approved by three reviewers with all CI checks passing. | |
| #1138 feat: improve error messages when parsing XML | craft-parts | merged | Merged enhancement improving XML parsing error messages in the maven-use plugin. Replaces unhelpful empty errors with full XML element output for debugging. Approved by two reviewers, passed all CI checks, and modified 5 files (+47/-14). |