Hello! I am using `api` instead of `implementation...
# gradle
m
Hello! I am using
api
instead of
implementation
for a dependency in my library, because my library builds as an extension on top of that library and would not be very usefull without. However, when someone uses my library the dependency declared with
api
is not exposed. Is there something I could have done wrong?
m
Maybe take a look at your pom file ?
m
It seems like adding
id("java-library") apply true
to plugins solved it (is it not supposed to work without it?) @mbonnin Sure, I am just off for lunch, will dig it up afterwards.
When I added the
id("java-library") apply true
I got this instead, which I want https://jitpack.io/com/github/zensum/ktor-auth0-permissions/26c0cab/ktor-auth0-permissions-26c0cab.pom
m
I'm actually surprised you can use api("com.typesafe") without applying the
java-library
plugin
m
Yes, so the problem is really that it is possible to use it without the plugin. You think you are using it but you don't. I have actually never used that plugin before, only the java plugin and the kotlin plugin.
m
That's the beauty of groovy, you can declare whatever you want and the (lack of) compiler will always be happy 🧌
m
Yeah, most of my more recent projects always uses Kotlin DSL instead. It its far from perfect either but I guess I would not have this problem there....?
o
Actually, the API configuration does exist, so it wouldn't fail there. The kotlin plugin adds a badly configured api configuration.
sorry, it used to do so, might depend on your project setup: https://youtrack.jetbrains.com/issue/KT-28355
❤️ 1
m
Okay, thank you @octylFractal