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

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.

The parameters needed depend on the version of Gradle that you are running.

If you are using the original publication version of Gradle use the Gradle Aritfactory Plugin.

if you are using the new publication version of Gradle use the Gradle Publishing Artifactory Plugin.

The Gradle Artifactory project is an open source project that is freely available for download.

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.

Page Contents

Gradle Artifactory Compatibility Table

This table summarizes compatible versions of Gradle and the corresponding Artifactory plugin version.

Gradle VersionArtifactory Plugin Version
gradle-1.0 and above2.0.17

gradle-1.8 and above

Gradle Artifactory Plugin v2.2.3 and above
gradle-2.0 and aboveGradle Artifactory Plugin  v3.0.0 and above

Configuring Artifact Resolution

Using the Gradle Build Script Generator

With Artifactory's Gradle Build Script Generator, you can easily create a Gradle init script that handles resolution.  

In the Home tab, select Client Settings | Gradle Build Script.

Plugin/Libs Resolver

The repository that should be used to resolve plugins/libraries

Use Maven/Use Ivy

When checked, specifies that resolving should be done using the Maven/Ivy pattern

Libs Publisher

The repository that should be used to publish libraries

Publish Maven Descriptor/

Publish Ivy Descriptor

When checked, specifies that library should be published using a Maven/Ivy descriptor

Repository Layout

Specifies the layout of the corresponding repository

Provisioning Dynamic Settings for Users

Artifactory lets you deploy and provision a dynamic settings template for your users.  Once downloaded, settings are generated according to your own logic and can automatically include user authentication information.

For more details, please refer to Provisioning Build Tool Settings section under Filtered Resources.


Sample Build Script and Properties

You can download sample scripts from the JFrog GitHub public repository.


Running Gradle

For Gradle to build your project and upload generated artifacts to Artifactory, you need to run the following command:

For more details on building your projects with Gradle, lease refer to the  Gradle Documentation.

Getting debug information from Gradle

We highly recommend running Gradle with the -d option to get useful and readable information if something goes wrong with your build.


Dependency Declaration Snippets

Artifactory can provide you with dependency declaration code snippets that you can simply copy into the Gradle Dependency Declaration section of your build.gradle file.

In the Repository Browser (Artifacts tab and then Browse | Tree Browser), drill down in the repository tree and select an artifact to display the corresponding dependency declaration that you can copy into your  build.gradle file.

 

 

  • No labels