Using Artifactory 6.x ?
JFrog Artifactory 6.x User Guide


Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width75

Overview

Artifactory provides tight integration with Gradle. All that is needed is a simple modification of your build.gradle script file with a few configuration parameters.

Both the new and older publishing mechanisms of Gradle are supported, however some of the steps to configure the Gradle Artifactory Plugin depend on the version you are using, and these are detailed in the documentation pages.

The Gradle Artifactory Plugin can be used whether you are running builds using a CI server, or running standalone builds. In either case, you should note the following points:

  1. CI Server Integration
    When running Gradle builds in your continuous integration server, we recommend using one of the Artifactory Plugins for JenkinsTeamCity or Bamboo.
    You can use your build server UI to configure resolving and publishing artifacts through Artifactory to capture exhaustive build information.
  2. Standalone Integration 
    The Gradle Artifactory plugin offers a simple DSL to perform the following steps in your Gradle build:
    1. Define the default dependency resolution from Artifactory.
    2. Define configurations that publish artifacts to Artifactory after a full (multi-module) successful build.
    3. Define properties that should be attached to published artifacts in Artifactory metadata.
    4. Capture and publish a build-info object to the Artifactory build-info REST API to provide a fully traceable build context.

Info
titleSource Code Available!

This Gradle Artifactory Plugin is an

Newtablink
Textopen source project on GitHub
URLhttps://github.com/JFrogDevJFrog/build-info/tree/master/build-info-extractor-gradle
which you can freely browse and fork.

The following sections describe the main configuration steps and provide a sample Gradle script that shows the information you need to get started using Gradle with Artifactory.

Column
Panel
titlePage Contents

Table of Contents
maxLevel4
minLevel2
 

Panel
titleRead more

Children Display

Panel
titleIntegration Benefits

Newtablink
TextJFrog Artifactory and Gradle Reositories
URLhttps://jfrog.com/integration/gradle/
 

...

You can download sample scripts from the JFrog

Newtablink
TextGitHub public repository
URLhttps://github.com/JFrogDevJFrog/project-examples
.

...

Running Gradle

...

For example, the following is a 

Newtablink
Textsimple use case
URLhttps://github.com/JFrogDevJFrog/project-examples/tree/master/gradle-examples/4/gradle-cache-example
 where the CI server builds a project and stores the build cache in Artifactory for later use by the following builds. This will greatly improve the build time in your local developer environments.

...