I have a plugin that creates a “resourceFiles” configuration, an adhoc component, and an alias maven publication for this resources artifact built alongside the main build:
project.extensions.findByType<PublishingExtension>()?.publications?.create<MavenPublication>("resourceFiles") {
from(component)
this as DefaultMavenPublication
isAlias = true
artifactId = "$artifactId-resource-files"
}
Now, in another module with the same plugin, when I add this project as a dependency in the resourceFiles
configuration:
dependencies {
resourceFiles(project(":dep"))
}
In its generated POM, the dependency corresponds to the main artifact (a.k.a. “dep”) instead of the resource file artifact (a.k.a. “dep-resource-files”).
How can I change the dependency to the resource-files artifact coordinates ?