9 steps to Upload your Java library to Bintray JCenter using Maven
3 min readJan 21, 2021
JCenter is the easiest way to add your Java artifacts as a part of this massive community. JCenter is a superset repository of maven central.
The most amazing feature is that the sync of your java library inclusion is seamless and immediate after approval.
In order to link a package to JCenter,
- the artifact first has to be published to Bintray.
- Then, the user sends a request to Bintray to link the package with JCenter.
Step 1: Create an OSS account in Bintray
- Click on Sign Up to an Open Source account
- Choose your desired way of signing up
Step 2: Create a Maven Repository
- Click on Add new Repository
- Choose repository type Maven from dropdown
Step 3: Create a Package
- Click on Add new Package
- Enter name, Version Control URL and your desired license from dropdown. Click on Create package.
- IMPORTANT NOTE : Version Control url should not start with http or https.
- Eg : www.github.com/hemanthsridhar
Step 4: Click on Set Me Up
Step 5: Click on Uploading
Step 6: Click on Deploying with Maven
Step 7: Click on Deploying with Maven
- Copy the server configuration section to your .m2/settings.xml
IMPORTANT NOTE : The password value is the APIKey value which can be found under Edit Profile
Copy the distributionManagement section to your pom.xml
- Below is a sample pom.xml to refer
Step 8: Deployment
- use the maven client to deploy
mvn clean deploy
Step 9: Add To JCenter
- Click on Add to JCenter button at the Bintray package page
- If your package type is pom, then click on is pom project checkbox.
- Click on the Send button.
THATS IT!
- After the package is approved, a badge that it is LINKED TO JCenter will appear at the Bintray Package Page
MANDATORY FILE REQUIREMENTS
Below are the mandatory requirements to include your java package into JCenter.
IF MAVEN PACKAGE TYPE IS .jar, .war, .aar, etc.
- GroupId and ArtifactId must be unique
- .jar / .war/ .aar is mandatory
- maven-metadata.xml is mandatory
- .pom is mandatory
- .sources is mandatory
Files optional :
- .javadocs
- .md5, .sha256, .sha512
- .asc
IF MAVEN PACKAGE TYPE IS .pom
- .pom is mandatory
- maven-metadata.xml is mandatory
Files optional :
- .sources
- .javadocs
- .asc