Unzip version catalog from jar

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(?????)
        }
    }
}

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.

That’s where i struggle… how to extract a file from a jar with zipTree that it can be passed to ‘from(…)’

zipTree("cat.jar").matching { include("path/to/your.toml") }