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

Using the Maven Publish plugin to publish a library

From the course: Gradle for Java-Based Applications and Libraries

Start my 1-month free trial

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…

Contents