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

Transitive dependencies spread into multiple repositories not resolved by default? #319

Open
martinbonnin opened this issue May 30, 2021 · 4 comments

Comments

@martinbonnin
Copy link
Contributor

martinbonnin commented May 30, 2021

I bumped a weird case where dependencies failed to resolve while they should in theory be there. To reproduce the issue, create a test.kts file containing:

#!/usr/bin/env kscript

@file:MavenRepository("gradleReleases", "https://repo.gradle.org/gradle/libs-releases-local/")

@file:DependsOn("net.mbonnin.kinta:kinta-lib:0.1.14")

The dependencies of kinta-lib are spread between mavenCentral and the gradleReleases repos and it looks like this is not supported:

$ ./test.kts 
[kscript] Detected missing dependencies in cache.
[kscript] Resolving dependencies...
[kscript] Resolving net.mbonnin.kinta:kinta-lib:0.1.14...
[kscript] Resolving com.github.holgerbrandl:kscript-annotations:1.4...
[kscript] [ERROR] Failed while connecting to the server. Check the connection (http/https, port, proxy, credentials, etc.) of your maven dependency locators. If you suspect this is a bug, you can create an issue on https://github.com/holgerbrandl/kscript
[kscript] [ERROR] Exception: java.lang.RuntimeException: File 'net.mbonnin.kinta:kinta-lib:0.1.14' not found
org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact org.gradle:gradle-tooling-api:jar:6.0.1 in maven central (https://repo.maven.apache.org/maven2/)
org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact net.mbonnin.kinta:kinta-lib:jar:0.1.14 in https://repo.gradle.org/gradle/libs-releases-local/ (https://repo.gradle.org/gradle/libs-releases-local/)

What's super weird is that adding mavenCentral explicitely fixes the issue:

@file:MavenRepository("mavenCentral", "https://repo1.maven.org/maven2/")

Environment:

$ kotlin -version
Kotlin version 1.5.10-release-890 (JRE 11.0.7+10)

$ kscript -version
Version   : v3.1.0

I always thought MavenCentral was included by default? Is there anything I'm missing?

@holgerbrandl
Copy link
Collaborator

Same here. I've tried to run it directly with the platform tools but this fails as well

script:

λ cat test.main.kts
#!/usr/bin/env kotlin

@file:Repository("https://repo.gradle.org/gradle/libs-releases-local/")

@file:DependsOn("net.mbonnin.kinta:kinta-lib:0.1.14")

execution attempt

λ kotlin test.main.kts
:: problems summary ::
:::: ERRORS
        unknown resolver jcenter.bintray.com

        unknown resolver jcenter.bintray.com

        unknown resolver jcenter.bintray.com

        unknown resolver jcenter.bintray.com

        unknown resolver jcenter.bintray.com

        unknown resolver jcenter.bintray.com

        unknown resolver jcenter.bintray.com

        unknown resolver jcenter.bintray.com

        unknown resolver jcenter.bintray.com

I'd consider this problem an upstream platform issue. I think you could consider filing a platform bug under https://youtrack.jetbrains.com/issues/KT

FYI @ligee

@martinbonnin
Copy link
Contributor Author

I can move that issue on the Jetbrains Issue Tracker. Do you know if there's a specific component or something that could help the jetbrain team triaging the bug efficiently? Does the resolver has a name? I think org.eclipse.aether is not managed by jetbrains right? So there's something on top of it?

@holgerbrandl
Copy link
Collaborator

They typically recategorize tickes very efficiently. Just submit it irrespective of kscript if possible to make clear that we think it's platform related. Feel welcome to add a reference to this thread.

@martinbonnin
Copy link
Contributor Author

I somewhat cannot reproduce with test.main.kts and Kotlin 1.5.21. I'll try to dig a bit more to see if I can make a reproducer using only platform components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants