[ 
https://issues.apache.org/jira/browse/HADOOP-20049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137856#comment-18137856
 ] 

ASF GitHub Bot commented on HADOOP-20049:
-----------------------------------------

pan3793 commented on PR #8903:
URL: https://github.com/apache/hadoop/pull/8903#issuecomment-6626223341

   > So following the best practice for dependency management we should declare 
the dependency where it is used ...
   
   I know someone calls it the best practice, Gradle even replaces the 
`compile` configuration with `implementation`(the module can only use the 
dependency classes but not its transitive dependencies at compile time) and 
`api`(more like Maven's `compile` scope), but I can not follow that, at least 
for Maven and normal Java software without using the Java Platform Module 
System (JPMS) - flattening all dependencies and concatenating all of them into 
the classpath, for example:
   
   - B depends on A v1
   - C depends on A v2
   - D depends on B and C, and uses A's API
   
   For Maven and normal Java software without using JPMS, you must choose one 
version of A, and all of B, C, and D see the pinned A version at runtime, then 
how does declaring A in D's pom.xml help? I don't think it solves the problem, 
unless it allows B, C, and D to use different versions of A at runtime.




> Keep slf4j-api at the managed version for consumers once Jetty 12 is in
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-20049
>                 URL: https://issues.apache.org/jira/browse/HADOOP-20049
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: build, common
>            Reporter: Jose Luis López
>            Assignee: Jose Luis López
>            Priority: Major
>              Labels: pull-request-available
>
> Jetty 12.1.14 declares {{org.slf4j:slf4j-api:2.0.17}} at compile scope; in 
> Jetty 9.4 it is provided and optional. It runs correctly on Hadoop's 1.7.36, 
> but the declaration reaches Maven consumers of the non-shaded artifacts. 
> {{hadoop-yarn-client}}, {{hadoop-hdfs}} and {{hadoop-hdfs-nfs}} depend on 
> Jetty directly, do not declare {{slf4j-api}}, and keep {{hadoop-common}} at 
> provided. A consumer declaring one of them before {{hadoop-client}} then 
> resolves {{slf4j-api:2.0.17}} with {{slf4j-reload4j:1.7.36}}. slf4j 2 ignores 
> that binding, so all logging goes to NOP, with only a warning on stderr. 
> Shaded clients are not affected.
> This must land before HADOOP-19972 or together with it. Hadoop stays on slf4j 
> 1.7.36. Moving to slf4j 2 is out of scope.
> *Verification:* with the fix, no published artifact resolves {{slf4j-api}} 
> 2.0.17 through Jetty, alone or declared before {{hadoop-client}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to