Working with Gradle and Artifactory
For Gradle to work with Artifactory, you only require a properly configured
To avoid dwelling on configuration details we shall just mention the main configuration steps and show a sample Gradle script that we believe shows all the required information needed to get you started.
It also demonstrates the effectiveness and brevity of Gradle.
Using Artifactory's Gradle Init Script Generator
With Artifactory's Gradle init script generator, you can easily create a Gradle init script that handles resolution. To do so go to the Home tab and then Client Settings -> Gradle Init Script:
Provisioning Dynamic Settings for Users
You can 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.
Refer to Provisioning Build Tool Settings section under Filtered Resources.
Manual Configuration Steps
Sample Build Script and Properties
And the properties file under the same directory:
The following clause is required for gradle to recognize Artifactory.
To build your project and upload the generated artifacts to Artifactory, run:
Please refer to the Gradle Documentation for more detailed information on building with Gradle (running sub-tasks etc.).
Getting Debugging Information from Gradle
If you experience problems, it is highly recommended to run Gradle with the
Dependency Declaration Snippets
Click on the Artifacts tab to use the Artifactory configuration to obtain dependency declaration snippets by selecting either an artifact and copying the "Gradle Dependency Declaration" section into your build.gradle file.