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
530 stars 227 forks source link

jf gradle error in bom resolution since 2.46.3 #2265

Open gregoryboue opened 11 months ago

gregoryboue commented 11 months ago

Describe the bug

Sinceand the Since the release of CLI version 2.46.3 and the use of the artifactory-gradle-plugin 5+, errors have appeared in dependency resolution for a project that has BOM dependencies and has declared a flatdir repository in its build.gradle.

Current behavior

With a project with the following minimalist build.gradle :

plugins {
    id 'org.springframework.boot' version '2.6.1'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

sourceCompatibility = '11'

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencyManagement {
    imports {
        mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2021.0.0'
        mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.1'
    }
}

If i run jf gradle clean assemble --info then the following error happens :

* What went wrong:
Execution failed for task ':bootJarMainClassName'.
> Could not resolve all dependencies for configuration ':detachedConfiguration1'.
  The project declares repositories, effectively ignoring the repositories you have declared in the settings.
  You can figure out how project repositories are declared by configuring your build to fail on project repositories.
  See https://docs.gradle.org/7.2/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
   > Could not find org.springframework.cloud:spring-cloud-dependencies:2021.0.0.
     Searched in the following locations:
       - file:/home/greg/git/gradle_tu/libs/spring-cloud-dependencies-2021.0.0.pom
       - file:/home/greg/git/gradle_tu/libs/spring-cloud-dependencies.pom
     Required by:
         project :
   > Could not find org.springframework.boot:spring-boot-dependencies:2.6.1.
     Searched in the following locations:
       - file:/home/greg/git/gradle_tu/libs/spring-boot-dependencies-2.6.1.pom
       - file:/home/greg/git/gradle_tu/libs/spring-boot-dependencies.pom
     Required by:
         project :

BOM dependencies are not retrieved from artifactory but only searched in the flatdir repository

Reproduction steps

sourceCompatibility = '11'

repositories { flatDir { dirs 'libs' } }

dependencyManagement { imports { mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2021.0.0' mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.1' } }


- With JFROG CLI 2.46.3+
- Use gradle wrapper 7.2 and java 11/17
- Run jf gradle-config to resolve dependency from artifactory (proxy to maven-central required)
- run `jf gradle clean assemble`

Then the error will appears.

Then try the same with JFROG CLI 2.46.2 and the bom are well fetched from artifactory

### Expected behavior

The expected behaviour is that the BOM as well fetched from remote as before 2.46.3

### JFrog CLI version

2.46.3+

### Operating system type and version

Ubuntu

### JFrog Artifactory version

7.55.10

### JFrog Xray version

3.79.11
gregoryboue commented 10 months ago

Hi, any news about this ?