Gradle Version Catalog and JavaFX Dependencies - Classifier

I am currently testing Version Catalog on a JavaFX project of mine. Therefore I need to update the dependencies and found something where I am stuck.

My dependencies are looking like this:

dependencies {
    implementation("org.openjfx:javafx-base:11.0.2:win")
    implementation("org.openjfx:javafx-fxml:11.0.2:win")
    implementation("org.openjfx:javafx-graphics:11.0.2:win")
    implementation("org.openjfx:javafx-controls:11.0.2:win")
    implementation("org.openjfx:javafx-web:11.0.2:win")
}

I’ve created a libs.versions.toml file to reference the
dependencies later

[versions]
javafx-win = "11.0.2:win"

[libraries]
javafx-base-win = { module = "org.openjfx:javafx-base", version.ref = "javafx-win" }
javafx-controls-win = { module = "org.openjfx:javafx-controls", version.ref = "javafx-win" }
javafx-fxml-win = { module = "org.openjfx:javafx-fxml", version.ref = "javafx-win" }
javafx-graphics-win = { module = "org.openjfx:javafx-graphics", version.ref = "javafx-win" }
javafx-media-win = { module = "org.openjfx:javafx-media", version.ref = "javafx-win" }
javafx-web-win = { module = "org.openjfx:javafx-web", version.ref = "javafx-win" }


[bundles]
javafx-win = ["javafx-base-win", "javafx-controls-win", "javafx-fxml-win", "javafx-graphics-win",
  "javafx-media-win", "javafx-web-win"]

The problem that occurs now is that the depdendencies could not be found e.g.

dependencies {
   implementation(libs.bundles.javafx.win)
}
> Could not find org.openjfx:javafx-base:11.0.2-win.
        Searched in the following locations:
          - https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/11.0.2-win/javafx-base-11.0.2-win.pom
        If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
        Required by:
            project :

404 Not Found to the website: https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/11.0.2-win/javafx-base-11.0.2-win.pom

Probably this path should be correct: Central Repository: org/openjfx/javafx-base/11.0.2

I would appreciate the help how I should configure the tomlfile.

Thanks in advance!

The classifier is not part of the version catalog.
There is no way to specify the classifier in the version catalog.
The classifier is part of the actual usage of the version catalog entry.

Thanks for the reply!

How does the notation looks like if i want to add a classifier when i use a version catalog entry?

implementation(variantOf(libs.foo) {
    classifier("bar")
})

thx for the reply. it didn’t work for me. I tried
implementation (variantOf(libs.log4j) {classifier(“sources”)})
which resulted in Could not find method variantOf() for arguments…

Works perfectly fine here.
How does the message continue after “arguments”?
Can you show an MCVE?

the complete message is “> Could not find method variantOf() for arguments [org.gradle.accessors.dm.LibrariesForLibs$Log4jLibraryAccessors@5b8d0fdd, build_9hi4efpzfo07zsuacu9s85ghk$_run_closure4$_closure26@59df85f] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.”

my Catalog looks like this
build.gralde of catalog project:
catalog { versionCatalog { alias(“log4j”).to(“log4j”, “log4j”).version(“1.2.16”) }}

the catalog is loaded via settings.gradle:

enableFeaturePreview(“VERSION_CATALOGS”)

dependencyResolutionManagement {
repositories { maven {url “${nexusUrl}/plugins/”} }
versionCatalogs { libs { from(“de.finkonsens.muest:versionCatalog:+”) } }
}

builde gradle:

plugins {
id “java”
id “java-library”
id “maven-publish”
}

dependencies { implementation (variantOf(libs.log4j) {classifier(“sources”)}) }

thx for your patiance

Works perfectly fine here.
Again the question, can you please provide an MCVE?
I’m not asking for that for fun.
But there is probably something very specific you do wrong.

thx alot, i found it by reducing the catalog to 1 line
to get the sources i defined a source lib alias(“log4j-sources”).to(“log4j”, “log4j”).version(“1.2.16-sources”) that caused the error

i did also open a thread yesterday with exactly this catalog. My problem there is, if i edit the catalog, publish it to nexus i have to delete it from the cache first to see the changes. Is there anything i can do to prevent the catalog.jar from beeing cached?