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:
- CI Server Integration
When running Gradle builds in your continuous integration server, we recommend using one of the Artifactory Plugins for Jenkins, TeamCity or Bamboo.
You can use your build server UI to configure resolving and publishing artifacts through Artifactory to capture exhaustive build information.
- Standalone Integration
The Gradle Artifactory plugin offers a simple DSL to perform the following steps in your Gradle build:
- Define the default dependency resolution from Artifactory.
- Define configurations that publish artifacts to Artifactory after a full (multi-module) successful build.
- Define properties that should be attached to published artifacts in Artifactory metadata.
- Capture and publish a build-info object to the Artifactory build-info REST API to provide a fully traceable build context.
|title||Source Code Available!|
This Gradle Artifactory Plugin is an
which you can freely browse and fork.
|Text||open source project on GitHub|
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.
|Text||JFrog Artifactory and Gradle Reositories|
You can download sample scripts from the JFrog
|Text||GitHub public repository|
For example, the following is a
|Text||simple use case|
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.