TheGoesen
11/14/2025, 9:14 AMVampire
11/14/2025, 10:33 AMgenerateMetadataFileFor...MavenPublication task and look at the generated file.TheGoesen
11/14/2025, 10:33 AMMartin
11/14/2025, 10:35 AMexecute theThis is exactly what I've been doing so fartaskgenerateMetadataFileFor...MavenPublication
Martin
11/14/2025, 10:35 AMMartin
11/14/2025, 10:36 AMMartin
11/14/2025, 10:37 AMVampire
11/14/2025, 10:37 AMTheGoesen
11/14/2025, 10:38 AMMartin
11/14/2025, 10:40 AMDon't understand what you mean.I'm not sure I do either ^^ I think what I'm trying to say is there are different "variant". You can have "outgoingVariant" without even applying the "publishing" plugin.
Martin
11/14/2025, 10:41 AM./gradlew outgoingVariant doesn't allow to debug the full outgoingVariant without applying the publishing pluginMartin
11/14/2025, 10:42 AMVampire
11/14/2025, 10:43 AMI think what I'm trying to say is there are different "variant". You can have "outgoingVariant" without even applying the "publishing" plugin.Ah, no, that is not different. You can also consume variants purely within the build even if you don't publish them. So let me correct what I said. Variants are variants of the project. And the project with all its variants is then published using a publication.
Martin
11/14/2025, 10:44 AMMartin
11/14/2025, 10:45 AMTheGoesen
11/14/2025, 10:45 AMMartin
11/14/2025, 10:45 AMVampire
11/14/2025, 10:49 AMHow do you publish an "outgoingVariant" to maven/npm/whatever
It's not really made for that. So the Gradle metadata publishing format leaks into the build tool modelI'm still not sure what you mean. The variants - speaking of files - are jars with classifier. And the metadata (only GMM as POM is simply not able to) knows about which variants exist and which artifact and dependency belongs to which variant. With pure POM, you would just have the classified jars and in the POM optional dependencies as POM just cannot know more by design. So yes, variants are of course made to be published, unless you configure a variant to not be published but to just be available within the build for cross-project dependencies, but not for external consumers.
Martin
11/14/2025, 10:53 AMvariants are of course made to be published, unless you configure a variant to not be published but to just be available within the build for cross-project dependencies, but not for external consumers.Exactly. The "variants" (as in
ConfigurationVariantMapping , etc...) exist irrespective of publishing. But all the concepts (attributes, etc...) are linked to the Gradle metadata JSON format.
The Gradle build tool is now tightly couple to the Gradle metadata formatMartin
11/14/2025, 10:54 AMMartin
11/14/2025, 10:55 AMMartin
11/14/2025, 10:55 AMVampire
11/14/2025, 10:55 AMConfigurationVariantMapping , etc...) exist irrespective of publishing. But all the concepts (attributes, etc...) are linked to the Gradle metadata JSON format.
> The Gradle build tool is now tightly couple to the Gradle metadata format
Not at all, it is exactly the other way around.
Variants have attributes, you use the attributes to resolve those variants, whether you publish them or not.
But if you publish them, you of course also publish the attributes along, so that downstream consumers can also resolve them properly.Martin
11/14/2025, 10:56 AMVariants have attributesWell, maven doesn't know at all about this.
Vampire
11/14/2025, 10:57 AMMartin
11/14/2025, 10:57 AMMartin
11/14/2025, 10:58 AMMartin
11/14/2025, 11:01 AMpublishing plugin.Vampire
11/14/2025, 11:03 AMVampire
11/14/2025, 11:04 AMVampire
11/14/2025, 11:13 AMdependencies task. Sounds like the dependencies task should get a switch for this to do it internally.
So for example
val foo by configurations.registering {
val myFeatureRuntimeElements by configurations.getting
extendsFrom(myFeatureRuntimeElements)
isTransitive = false
}
and then ./gradlew dependencies --configuration fooTheGoesen
11/14/2025, 11:16 AMVampire
11/14/2025, 11:16 AMVampire
11/14/2025, 11:17 AMVampire
11/14/2025, 11:17 AMTheGoesen
11/14/2025, 11:20 AM