then why do I still see it, if the lib includes th...
# gradle
u
then why do I still see it, if the lib includes the gson via
implementation
anyways?
o
implementation
only affects consumers of your program, not of the library mentioned in the declaration
i.e. if someone depended on your code, they would not see the 3rd party lib or GSON
it does not control if the 3rd party lib leaks its transitive dependencies to your compile classpath, which it clearly does. there's not much you can do to fix this besides asking them to properly separate their transitive dependencies (I don't recommend blindling excluding transitive dependencies since they won't end up on your runtime classpath without careful handling)
u
okay so youre saying A > B > C, if B includes implementation of C, then A wont see C right?
o
yes, if
B
had
implementation(C)
,
A
would not see
C
but if
B
is e.g. a maven project and declares a normal dependency on
C
, then
A
having
implementation(B)
would still allow it to see
C
u
okay, but this still doesnt explain it why does B sees Gson if its B > C > Gson
if C.implementation(Gson)
(C is the 3rd party lib)
o
are you sure that
C
has
implementation(Gson)
?
u
and in my build.gradle ,
Copy code
implementation "com.exponea.sdk:sdk:2.4.0"}
o
hmm, I'm not sure why, but the real source of truth is the pom.xml: https://repo1.maven.org/maven2/com/exponea/sdk/sdk/2.7.2/sdk-2.7.2.pom which clearly states that everything is in the compile scope, not the runtime scope, meaning it will be included on your compile classpath
typically using
implementation
will result in the published pom.xml having a scope of
runtime
for those dependencies, but maybe that only happens if the
java-library
plugin is applied to the project
u
okay, so, if I implementation exponea, when I should only see exponea own code, not its dependencies, right?
(if all went well, just to clarify)
o
pretty much, since it declares no
api
dependencies -- if it did you would see those
u
okay so atleast I understood it correctly all along. Im going to open up a ticket with them, thank you!