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

refreshVersions not working with flatDir repository #401

Open
1 task
ramartinroucek opened this issue Aug 10, 2021 · 0 comments
Open
1 task

refreshVersions not working with flatDir repository #401

ramartinroucek opened this issue Aug 10, 2021 · 0 comments
Labels
help wanted Extra attention is needed problem Something isn't working

Comments

@ramartinroucek
Copy link

🐛 Describe the bug

Gradle command refreshVersions is not working with gradle flatDir repository. This repository is used to target libraries locally from disk. Example of a such repository definition in build.gradle.kts:

    repositories {
        ..
        flatDir {
            dirs("${rootProject.projectDir}/libs/")
        }
    }

⚠️ Current behavior

The refreshVersion task tries to search for all dependencies even for the local libraries from "flatDir" repository which leads to following exception:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':refreshVersions'.
> ModuleId(group=local-library, name=local-library) not found. Searched the following repositories:
  - https://repo.maven.apache.org/maven2/

Start of exception:

Caused by: java.util.NoSuchElementException: ModuleId(group=local-library, name=local-library) not found. Searched the following repositories:
- https://repo.maven.apache.org/maven2/

        at de.fayard.refreshVersions.core.internal.GettingVersionCandidatesKt.getVersionCandidates(GettingVersionCandidates.kt:75)
        at de.fayard.refreshVersions.core.internal.GettingVersionCandidatesKt$getVersionCandidates$8.invokeSuspend(GettingVersionCandidates.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)

✅ Expected behavior

There are two options how to solve this problem:

  1. Skip version lookup for libraries from flatDirs, because these libraries are not usually listed on public repositories.

  2. Instead of throwing exception just warn on standard output that the library could not be found. The old version of this plugin called "buildSrcVersions" behaves like this, it print out message like this:

Failed to determine the latest version for the following dependencies (use --info for details):
 - local-library

💣 Steps to reproduce

Create a flatDir repository with at least one library which is used as dependency.

@jmfayard jmfayard added the problem Something isn't working label Aug 10, 2021
@LouisCAD LouisCAD added the help wanted Extra attention is needed label Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed problem Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants