Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Support flatDir repositories" breaks the usage of custom Ivy Repositories #121

Open
BlueVirusX opened this issue Jul 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@BlueVirusX
Copy link

BlueVirusX commented Jul 29, 2024

Describe the bug

The PR #118 breaks the usage of custom Ivy Repositories.

We are using Ivy desciptors like below to load artifacts from a Github mirror (generic remote repository).

allprojects {
  repositories {
    exclusiveContent {
      forRepository {
        ivy {
          name "github-binary"
          url "${artifactory_contextUrl}/github-binary"
          patternLayout {
            artifact '[organisation]/[module]/releases/download/[revision]/[artifact].[ext]'
            artifact '[organisation]/[module]/archive/release-[revision].[ext]'
            artifact '[organisation]/[module]/archive/[revision].[ext]'
            artifact '[organisation]/[module]/archive/refs/tags/[revision].[ext]'
            artifact '[organisation]/[module]/archive/refs/heads/[revision].[ext]'
          }
          metadataSources {
            artifact()
          }
          credentials {
            username = artifactory_user ? "${artifactory_user}" : ""
            password = artifactory_password ? "${artifactory_password}" : ""
          }
          authentication {
            basic(BasicAuthentication)
          }
        }
      }
      filter {
        includeModule('google', 'bundletool')
      }
    }
  }
}

configurations {
  tools
}

dependencies {
  tools(group: 'google', name: 'bundletool', version: bundletoolVersion) {
    artifact {
      name = "bundletool-all-${bundletoolVersion}"
      extension = 'jar'
      type = 'jar'
    }
  }
}

Current behavior

07:46:07  1: Task failed with an exception.
07:46:07  -----------
07:46:07  * What went wrong:
07:46:07  Execution failed for task ':resolve'.
07:46:07  > Could not resolve all files for configuration ':tools'.
07:46:07     > Could not find google:bundletool:1.17.1.
07:46:07       Required by:
07:46:07           project :

Reproduction steps

No response

Expected behavior

Ivy dependency resolution should work as before.

Artifactory Gradle plugin version

5.2.3

Operating system type and version

macOS 14.5

JFrog Artifactory version

7.84.17

Gradle version

8.9

@BlueVirusX BlueVirusX added the bug Something isn't working label Jul 29, 2024
@yahavi
Copy link
Member

yahavi commented Jul 31, 2024

@BlueVirusX

Thank you for reporting this issue.
#118 is intended to modify the resolution repositories only if a resolution server is configured by the JFrog CLI. Could you please provide the steps to reproduce it? What command did you run? Are there any special configurations involved? Also, are you using the JFrog CLI?

Thanks!

@BlueVirusX
Copy link
Author

JFrog CLI ist not involved but a self-made Gradle plugin, which I am unable to share.
The plugin adds a custom Gradle task to reolve dependencies from configurations. Something like this:

project.configurations.each { conf ->
  conf.collect { dep ->
    project.copy {
      from dep
      into destination
    }
  }
}

When I am checking the logs from Gradle I see the following diffenerence when resolving dependencies:
OLD:

...
12:20:35  2024-07-31T12:20:35.070+0200 [INFO] [org.gradle.api.Task] bundletool
12:20:35  2024-07-31T12:20:35.070+0200 [INFO] [org.gradle.api.Project] ----- files: ------
12:20:35  2024-07-31T12:20:35.070+0200 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'android-maven' [64bad6364ebebf5c47dd747ac6593952].
12:20:35  2024-07-31T12:20:35.071+0200 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'dependencies' [2b7d14ced1558558cfcf714198f3d5c2].
12:20:35  2024-07-31T12:20:35.071+0200 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'github-binary' [2f40694d301f2cd12609a2261df2dc07].
12:20:35  2024-07-31T12:20:35.071+0200 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'maven' [f67e554f77cb2a0ac6b7de4c98bb5355].
...

NEW:

...
11:46:50  2024-07-31T11:46:50.219+0200 [INFO] [org.gradle.api.Task] bundletool
11:46:50  2024-07-31T11:46:50.219+0200 [INFO] [org.gradle.api.Project] ----- files: ------
11:46:50  2024-07-31T11:46:50.220+0200 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'artifactoryResolutionRepository' [f67e554f77cb2a0ac6b7de4c98bb5355].
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants