From the course: Gradle for Java-Based Applications and Libraries
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Using the Maven Publish plugin to publish a library
From the course: Gradle for Java-Based Applications and Libraries
Using the Maven Publish plugin to publish a library
- To make a library consumable by other projects, you will have to publish it to a binary repository. With Gradle, you can express what artifacts to publish where for given group, artifact ID, and version. In this video, you will learn how to publish a library to a Maven repository using the Maven Publish plugin. Say we wanted to publish an artifact that bundles the classes of the API module so that it can be reused in other projects. We'll navigate to the project and start by applying the plugin with the identifier Maven dash publish. The plugin exposes an extension we can use to configure the target repository and the artifacts to publish. For the API module, the publication to publish is the Java component. A Java component effectively is the job file created by the project. Additionally, we also need to define the group ID and the artifact ID used for the artifact. The version has already been defined in the build…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Mechanics of dependency management1m 59s
-
(Locked)
Declaring a dependency on an external library2m 38s
-
(Locked)
Rendering the dependency tree2m 36s
-
(Locked)
Declaring a project dependency3m 5s
-
(Locked)
Using the Maven Publish plugin to publish a library3m 7s
-
(Locked)
Challenge: Consuming an external dependency1m 44s
-
(Locked)
Solution: Consuming an external dependency3m 29s
-
(Locked)
-
-