How To Use Gradle API vs. Implementation Dependencies (Java Library Plugin)

preview_player
Показать описание
The Gradle Java Library Plugin is the recommended plugin to use when building libraries that will be consumed by another project. It offers the ability to distinguish between api and implementation dependencies, offering some key benefits for whoever consumes the library.

In this video you’ll learn the main differences between api and implementation configurations with a real-world example showing exactly how things work under the covers.

GITHUB
Get the code used in the example in the video:

THIS VIDEO IN ARTICLE FORMAT

DOCS

Рекомендации по теме
Комментарии
Автор

I spent hours of research and couldn't understand until i found this video. Thank you so much

rockmanvnx
Автор

Cannot access =>
IntelijIdea, but in eclipse ok ... why?

lisafox
Автор

What the equivalent to dependency management in maven to gradle?

GSUGambit
Автор

Thank for example about plugin "maven-publish". It's very helpful

alexei
Автор

It took me a whole while to actually understand the older ones, but only after a short while, Gradle changed into implementation and api. However, the older ones (Maven conventions) are more straight-forward right?

We used to have
compile - For compile & runtime classpaths
provided - For compile classpath but not runtime classpath
runtime - For only runtime classpath

After spending so much time to understand the above and seeing Gradle changed them immediately later, made me stick to implementation which simply worked everywhere I go. Thanks for this video, I finally understand the new approach too.

SriHarshaChilakapati
Автор

What is the api equivalent for annotationprocessor for lombok

praveenathangavel
Автор

Excellent explanation, to the point.
Thank you so much.

rajdhar
Автор

Your IntelliJ IDEA Theme doesn't correlate with your room and t-shirt Theme. Please make it IntelliJ Light as well :-)

krown
Автор

Awesome! This is what I am looking for a visual representation of what is happening behind the scene.

One more question, what will happen if I change jackson from api to implementation in consumer side

bitwisedevs
Автор

thank you for great explanation. So basic, so clear and yet, detailed enough to generate and use library.

Firaristt
Автор

Excellent video, really well covered. Again how a friendly suggestion: consider to do a new video of this same type but covering about Testing. There are other 'names' about how to refer the dependencies. Keep doing this amazing work!

manueljordan
Автор

The jacket in the background disturb me a lot :)

krzysztofkamieniecki
Автор

Awesome video thank you. Do you have anything planned about how to handle non jar dependencies from zip files like dlls/js/.. ?

gullujumper
Автор

didn't quite get this before your explanation.. the way you showed the published maven pom artifact lit the light bulb in my thick head ;^) thnx !

buildlackey
Автор

Hi, very good demonstration! It would be nice if you can demonstrate compileOnly, runtimeOnly and annotationProcessor :)

KonradSzewczukMusic
Автор

A problem occurred evaluating root project 'library'.
> Cannot create a Publication named 'MavenPublications' because this container does not support creating elements by name alone. Please specify which subtype of Publication to create. Known subtypes are: MavenPublication

lewismachilika
Автор

It would be nice to talk to the rest of the world learning the tools who haven't been using them for 1+ years. You should start by giving a reference to build on. Visualize your reference. Thanks for the effort. Now I need to go to a source that can get me up to speed to understand what you're saying.

tonys
Автор

Your Gradle series is brilliant. Thank you, Tom.

JoseGarcia-bnkq
Автор

Excellent video :-). can I transform the library module to be used as a BOM into de Consumer? If yes, should I include a pom that list all my libs into my Library module?

tassitanoca