sge
March 14, 2023, 8:21am
1
i have a libs.versions.toml that is inside a jar. how is it possible to exctract the file from the jar and use it as a version catalog in the settings.gradle file?
code of dependencyResolutionManagement in settings.gradle file:
dependencyResolutionManagement {
repositories {
mavenLocal()
}
versionCatalogs {
libs {
from(?????)
}
}
}
Vampire
(Björn Kautler)
March 14, 2023, 10:21am
2
Assuming you talk about a properly published version catalog, here is the way to import it: Sharing dependency versions between projects
If for wahtever reason you really talk about a version catalog file trivially put to jar, use zipTree
to access and use it.
sge
March 14, 2023, 12:07pm
3
That’s where i struggle… how to extract a file from a jar with zipTree that it can be passed to ‘from(…)’
Vampire
(Björn Kautler)
March 14, 2023, 1:04pm
4
zipTree("cat.jar").matching { include("path/to/your.toml") }