Giuseppe Barbieri
06/24/2024, 3:47 PM.module and then the catalog .toml and inject those into the publications (alongside with the hardcoded comment on the pom.xml)
I can successfully depends on the platform, but whenever I try to use the catalog, I get:
> ould not resolve all artifacts for configuration 'incomingCatalogForLibs0'.
> > Could not resolve org.scijavapom scijava38.0.0-SNAPSHOT.
> Required by:
> unspecifiedunspecifiedunspecified
> > No matching variant of org.scijavapom scijava38.0.0-SNAPSHOT:20240623.051958-54 was found. The consumer was configured to find attribute 'org.gradle.category' with value 'platform', attribute 'org.gradle.usage' with value 'version-catalog' but:
while the org.gradle.usage are all set to java-api
Is there a workaround for this?Vampire
06/24/2024, 3:57 PMjavaPlatform which is the platform.
For the version catalog you need to publish the component versionCatalog.Giuseppe Barbieri
06/24/2024, 3:57 PMVampire
06/24/2024, 4:02 PMGiuseppe Barbieri
06/24/2024, 4:04 PMVampire
06/24/2024, 4:06 PMif (getComponent().isPresent()) {
throw new InvalidUserDataException(String.format("Maven publication '%s' cannot include multiple components", name));
}Vampire
06/24/2024, 4:06 PMGiuseppe Barbieri
06/24/2024, 4:08 PMVampire
06/24/2024, 4:10 PMGiuseppe Barbieri
06/24/2024, 4:15 PMapiElements2 and runtimeElements2?Vampire
06/24/2024, 4:16 PMapiElements and runtimeElements.
The version catalog plugin publishes versionCatalogElements.Vampire
06/24/2024, 4:18 PMval javaPlatform by components.existing {
this as AdhocComponentWithVariants
val versionCatalogElements by configurations
addVariantsFromConfiguration(versionCatalogElements) {
}
}Giuseppe Barbieri
06/24/2024, 4:20 PM.module file
"variants": [
{
"name": "versionCatalogElements",
"attributes": {
"org.gradle.category": "platform",
"org.gradle.usage": "version-catalog"
},
"files": [...]
}
]Giuseppe Barbieri
06/24/2024, 4:22 PM