Chapter 6. Publishing to Bintray

In the previous chapter, we learned how to deploy our artifacts to a Maven repository. In this chapter, you will learn how we can deploy our artifacts to Bintray as a Maven repository. We will see what Bintray is and how it helps to publish our project.

We will see how we can configure the Gradle Bintray plugin to deploy our artifacts.

What is Bintray?

Bintray advertises itself as a Distribution as a Service. This means that when we have something we want to distribute, for example our project artifacts, we can use Bintray. Bintray offers a platform to store the software we want to share and makes it accessible for others to download. Around this, there is a lot of tooling to provide insights into how the packages are distributed and used. Bintray also offers a REST API to make it easy to work with the platform. The company running Bintray is JFrog, which is very well known for its repository product, Artifactory.

A part of Bintray is called JCenter. JCenter hosts Java dependencies within the Bintray platform. We already learned about JCenter as a repository host for dependencies. However, we can also use JCenter as a distribution repository for our own dependencies. In this chapter, we are going to use JCenter to deploy our artifacts.

Defining a new repository

Before we can use Bintray's JCenter, we must create an account with Bintray at https://bintray.com. One of the easiest ways is to use your existing GitHub account to sign in.

Next, we will create a new repository in which we will store our artifacts. So, first we log in to Bintray. From our user page, we will select the New repository option. In our browser window, we can see some fields we need to fill in, as shown in the following screenshot:

Defining a new repository

We need to give our repository a name and an optional description. We choose Maven as the type of repository. Bintray can also be used for other types of dependencies, but for our Java code we want to use Maven. After we have filled in all the fields, we click on the Create button, and Bintray creates a new and empty repository. In the next screenshot, we will see our newly created repository:

Defining a new repository
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.59