jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
531 stars 231 forks source link

Ability to use artifactory to resolve gradle buildscript dependencies #1703

Open gregoryboue opened 2 years ago

gregoryboue commented 2 years ago

Is your feature request related to a problem? Please describe.

When i use jfrog cli to execute jf gradle command (after jf config), the dependency resolution works well for my project dependency. But if i have a private buildscript dependency on the repository that i configured with jf config command, it is not resolved and I can see this error message :

A problem occurred configuring root project...
> Could not resolve all files for configuration...
> Could not find ...

Describe the solution you'd like to see

It would be great if the dependency resolution through jfrog CLI also works for buildscript dependencies resolution.

Describe alternatives you've considered Add special configuration through init.gradle file or in build.gradle but I doesn't want to put any creds in source code

eyalbe4 commented 2 years ago

@gregoryboue, To make your gradle build download the buildscript depedencies from your Artifactory repository, you'll need to configure your repository in the buildscript section as part of your gradle script. You can pass the connection details as parameters to your gradle build.

buildscript {
  repositories {
     maven {
        url "https://my-jfrog-instance/artifactory/libs-release"
        credentials {
          username "${jfrog_user}"
          password "${jfrog_password}"
        }
    }
  }
}
gregoryboue commented 2 years ago

Hi,

Thanks for the answer, i know this solution but from my point of view, the goal of using jfrog CLI to build project is to configure artifactory connection once with jf config command. In CI pipeline context, i don't want to put my artifactory auth information in my buildscript bloc.