[
https://issues.apache.org/jira/browse/MDEP-791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17494068#comment-17494068
]
Thorsten Glaser commented on MDEP-791:
--------------------------------------
[~elharo] there was much discussion about this in
https://issues.apache.org/jira/browse/MDEP-753
The problem here is:
* jackson-databind *does* declare a dependency on jackson-core
* src/main/ directly uses classes from jackson-databind, but none from
jackson-core
** these classes *derive from* classes in jackson-core
* src/test/ directly uses classes from jackson-core
With direct dependencies on jackson-databind and jackson-core, MDEP says
test-only dependency jackson-core (because src/main/ does not use it). But
there’s no fix that can be used with the current model because:
* adding {{<scope>test</scope>}} to jackson-core removes it from the
transitive compile dependencies, making compile fail
* removing jackson-core from direct dependencies (rightfully) gives an MDEP
warning because src/test/ directly uses it
> Non-test scoped and transitive dependencies in compile scope
> ------------------------------------------------------------
>
> Key: MDEP-791
> URL: https://issues.apache.org/jira/browse/MDEP-791
> Project: Maven Dependency Plugin
> Issue Type: Bug
> Affects Versions: 3.2.0, 3.3.0
> Reporter: Slawomir Jaranowski
> Priority: Critical
> Attachments: MDEP-791.zip
>
>
> When we use some dependency in test classes which is not used in production
> code but is required as transitive dependency for other used in production
> code - such dependency should not be included in {*}{{Non-test scoped}}{*}.
> Example:
> * test code use {{ObjectCodec}} from {{jackson-core}}
> * production code use only {{ObjectMapper}} from {{jackson-databind}}
> * production code don't use any classes from {{jackson-core}}
> {{jackson-core}} is needed by {{jackson-databind}} and must by in compile
> scope so should not be reported as {{Non-test scoped}}
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)