Understanding Gradle #12 – Publishing Libraries

preview_player
Показать описание
What is a Maven Repository and how do I publish my libraries/components to it?

▶️ 0:00 Publishing libraries
▶️ 0:15 Maven repository structure
▶️ 1:35 Gradle Module Metadata
▶️ 2:51 Configure publishing for library subprojects
▶️ 4:26 DSL concepts for publishing: "components"/"publications"
▶️ 6:11 Configure repositories to publish to
▶️ 6:54 Running publish tasks
▶️ 7:11 Using published versions of libraries
▶️ 8:41 Summary

Related Videos:

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

This was very helpful! Especially loved the explanations and use of kts! Thank you!

ShaunBurch
Автор

This video is great, but can you explain how to publish the plugins themselves? I'm trying to run Arquillian integration tests on project 'server' that uses the convention plugin 'com.my.server' and it complains that the plugin can't be found in the repositories. So I added 'mavenLocal()' to the repositories in its settings file and now I want to publish the plugin there. The problem I'm having is that declaring any publishing configuration on the plugin itself will actually configure the project for publishing as you've shown, while I want to configure the plugin for publishing.

I tried to do this configuration on the build file of the plugins project itself. One problem here is that now it publishes all the plugins, including the parent plugins project, and that they will all have the same version. Another is that I end up with the groupId being 'com.my.server' and the artifactId being 'com.my.server.gradle.plugin' (the file name is 'com.my.server.gradle'), so now I have duplication of the 'com.my' part. I'm confused as to the roles of the file name vs. the 'group = "com.my"' configuration.

I would like to have the following:
- the file name shouldn't have the 'com.my' part, just "server.gradle", if it's even possible and correct (I thought defining the group name to 'com.my' will do the trick)
- the publishing location in the local maven repo will be to and not or just '.m2/repository/server', which are 2 results I'm getting as I play around with this
- the plugin declarations of 'server' should use 'id "com.my.server" version "1"' and not 'id "server" version "1"'
- be able to define the version of each of the convention plugins and not have them share the same version

As you can see, I'm confused about where to declare things and what name gets copied to where when dealing with plugins. Would be very grateful for any help.

Omega
Автор

Great Video, Only Real Developers Value know it's value

cirline
Автор

hi
do you have videos about release version management
for how to automate version increment

AliaksandrSmirnou
Автор

Here you define manual version but how we can increment this version automatically

amitverma