Details
-
New Feature
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
3.2.0, 3.3.0
-
None
-
None
Description
This was found due to testing whether 3.3.0-SNAPSHOT fixes the regressions of 3.2.0 against 3.1.2 (it doesn’t, yet).
After finding https://maven.apache.org/guides/development/guide-testing-development-plugins.html I was able to test the snapshot on the https://github.com/tarent/extract-tool/tree/mdep753-snapshot branch as well.
This problem shows up:
$ mvn dependency:analyze-only@analyse-dependency-usage
[…]
[WARNING] Non-test scoped test only dependencies found:
[WARNING] com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.13.1:compile
This is “correct”: com.fasterxml.jackson.dataformat.yaml.YAMLFactory is imported in the tests but only used via reflection in prod because it’s an optional (but not marked as optional so it’s included by default, but users can <exclude> it and that’s supported and documented) dependency. This means it’s a false positive that cannot be expected to be handled by the test correctly and must be overridden in the POM.
However, adding it as <ignoredUnusedDeclaredDependency> does not work ☹ it’s probably the wrong overriding element, but https://maven.apache.org/plugins/maven-dependency-plugin/analyze-only-mojo.html does not have anything on how to override this particular warning.
This is a must-have for, I hope, obvious reasons…
Attachments
Issue Links
- relates to
-
MDEP-753 Non-test dependency reported as Non-test scoped test only dependency
- Closed
- links to