https://kotlinlang.org logo
Title
m

mantono

10/23/2019, 10:25 AM
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

mbonnin

10/23/2019, 10:37 AM
Maybe take a look at your pom file ?
m

mantono

10/23/2019, 10:40 AM
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

mbonnin

10/23/2019, 12:06 PM
I'm actually surprised you can use api("com.typesafe") without applying the
java-library
plugin
m

mantono

10/23/2019, 12:24 PM
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

mbonnin

10/23/2019, 12:32 PM
That's the beauty of groovy, you can declare whatever you want and the (lack of) compiler will always be happy :troll:
m

mantono

10/23/2019, 3:41 PM
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

octylFractal

10/23/2019, 4:22 PM
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

mantono

10/23/2019, 9:31 PM
Okay, thank you @octylFractal