Skip to end of metadata
Go to start of metadata
Table of Contents

Target Audience

OSS contributors who want a free repository to host build snapshots and eventually publish release versions to distribution via Bintray without hassle.

What is OJO

oss.jfrog.org or OJO for short, is a Cloud Artifactory instance for hosting your maven-compatible build snapshots, provided free of charge for selected opensource software projects.

All projects in OJO are public (all the artifacts and the builds are viewable to all).

Exiting Bintray users are granted deploy permissions to relevant folders in Artifactory, according to the Maven group ID of the packages they build.

In a Glance

This page describes the process of on-boarding to OJO; working with it to deploy continuous snapshots; and, finally, promoting these snapshots from OJO to Bintray for distribution.

It only takes three simple steps:

  1. Creating an account on OJO
  2. Build and deploy to the OJO Artifactory
  3. Promote a snapshot build to Bintray

Getting Started with OJO

To get account on OJO you have to have an account on Bintray.

  1. Create a Maven repo on Bintray if it does not exist yet, and create your package inside this repo.
    You can give your package any logical name, for example: maven2gradle
  2. Ask for inclusion of the package in JCenter, by clicking the "Add to JCenter" button in the package main page.
    In the request form, check "Host my snapshot build artifacts on the OSS Artifactory at https://oss.jfrog.org" and enter the desired Maven group ID for your package.
    For example: org.github.jbaruch.maven2gradle

After your request has been approved by Bintray Team (usually within just a couple of hours), you'll receive two confirmation emails - one for the inclusion of your package in JCenter and another one for your new OJO account.

OJO is Artifactory!

OJO is just a regular Artifactory Pro server, so getting familiar with Artifactory is recommended.

Bintray Organizations Support

When asking OJO account for an organizational repository, the permissions in OJO will be granted to all the organization members, not only the member who asked for the OJO account.

Working with OJO

After your OJO account has been created you (and all the team members in case of organization repository) should be able to login to OJO using your Bintray username and API key as the password.

You will see that a folder corresponding to the Maven group ID has been created in OJO in the oss-release-local and the oss-snapshot-local repositories:

You have deploy permissions to these folders:

Resolving from and Publishing to OJO

Working with snapshots repository is nothing special, you can configure your build tool to resolve release and snapshot dependencies from the libs-release and the libs-snapshot OJO virtual repositories, respectively; and to deploy build snapshots to the oss-snapshot-local repository.
As long as the <groupId> in your pom (for Maven) or the project.group (for Gradle) matches the group ID you requested during onboarding, the deployment should succeed.

Please consult the Artifactory documentation on how to set up your Maven or Gradle for resolution and deployment.

Artifactory Build Info is a must!

In order to release and promote snapshots to Bintray you need to deploy a Build Info BOM to Artifactory. The easiest way to achieve this automatically it is to use Build Integration feature of Artifactory or the Gradle Artifactory Plugin; These and other options are described in the next section.

Releasing to Bintray

Currently, you have two ways to deploy artifacts to Bintray:

  1. Promoting a Release Build
    This will promote snapshot artifacts to release and the deploy them to Bintray:
    1. Use promotion from the Jenkins Artifactory plugin - This allows you to use the Jenkins UI to promote the snapshot artifacts from a selected job run.
    2. Invoking promotion with REST - This allows promotion of a build created with any build server/tool and full programatic automation of the promotion process.
  2. Uploading Release Artifacts
    Directly upload deployed release artifact to Bintray. If you have a released version of an artifact or a build you can deploy them to Bintray using the regular Bintray integration .

Promoting a Release Build

Promoting a Build from Jenkins

Promotion from Jenkins is performed by invoking a custom "snapshotsToBintray" promotion plugin. Here's what you need to do:

  1. Install the Jenkins Artifactory Plugin and configure Artifactory servers and repositories in Jenkins configuration as described in the documentation. You should configure the oss-release-local and oss-snapshot-local as release and snapshot targets, respectively.
  2. In your build configuration, add the "Deploy artifacts to Artifactory" post build action and check "Deploy Maven artifacts", "Capture and publish build info" and "Allow promotion of non-staged builds":
  3. Run your build. Upon successful completion, the build result page will have a link to the "Artifactory Release Promotion" action:
  4. In the promotion configuration screen, select "snapshotsToBintray" promotion plugin:

    There are two parameters to configure here:
    1. Override the release version. By default, the version is calculated by removing the -SNAPSHOT suffix from the snapshot version, e.g. 1.0-SNAPSHOT will be released to Bintray as version 1.0.
      Specifying a value in this field overrides the default version scheme.
    2. Append a timestamp to the version. This will add a timestamp string (in Maven's timestamp format: yyyyMMdd.HHmmss) to the release version. Values of true, y or 1 will cause the timestamp suffix to be appended.
  5. Click the "Update" button. Your release artifacts are in Bintray now.

Promoting a Build Using REST API

If you don't use Jenkins or if you need fully automated promotion, you can issue a HTTP PUT request that will trigger promotion and release to Bintray.Promotion still operates on a Build Info BOM, previously saved in Artifactory.
Here's what you need to do:

  1. Deploy a build to Artifactory in one of the following ways:
    1. Using a build server with Artifactory plugin. Plugins currently exist for Jenkins, Hudson, Bamboo and TeamCity. Please see the Artifactory Build Integration documentation for further instructions on getting build info BOM into Artifactory.
    2. Using the Gradle Artifactory Plugin.
    3. Configure Maven to use Artifactory Listener as described here  .
  2. Execute the build promotion plugin call. The call accepts the same parameters as the invocation of Jenkins promotion plugin. Here's an example using CURL:
    curl -X POST -u bintrayUser:apiKey http://oss.jfrog.org/api/plugins/build/promote/snapshotsToBintray/buildName/3

 

 

 

 

  • No labels