Ryan Trontz
03/07/2024, 3:52 PMmaven-metadata.xml file for a plugin I’m publishing. Here’s the situation:
I currently publish this gradle plugin to mavenRepo1. I’m curious about a new repository, so I’d like to also publish to mavenRepo2.
When I attempt to publish, I get a 404 error that maven-metadata.xml cannot be found when publishing to mavenRepo2.
When I look in /build/tmp/publishPluginNameMarkerMavenPublicationToMavenRepo2Repository, there’s no mave-metadata.xml , but the same folder for mavenRepo1 .
I’m having this issue with both snapshot and release publishing.
I’m not using any custom config for this file, and I’m not sure why it’s not being created for the new repository. Does anyone have any insight here?
Here’s my publishing block in the plugin’s build.gradle file:
publishing {
repositories {
maven {
name = 'mavenRepo1'
credentials {
username = '<username>'
password = '<password>'
}
afterEvaluate {
url = version.endsWith('SNAPSHOT')
? '<snapshot-repo-url>'
: '<release-repo-url>'
}
}
maven {
name = 'mavenRepo2'
credentials {
username = '<username>'
password = '<password>'
}
afterEvaluate {
url = version.endsWith('SNAPSHOT')
? '<snapshot-repo-url>'
: '<release-repo-url>'
}
}
}
}Vampire
03/07/2024, 5:21 PMAbstractMavenPublisher unless you got some exception.
Maybe you want to set a breakpoint there and check what is happening.Ryan Trontz
03/07/2024, 9:06 PM> Task :generateMetadataFileForpluginNamePluginMarkerMavenPublication SKIPPED
Maven publication 'pluginNamePluginMarkerMaven' isn't attached to a component. Gradle metadata only supports publications with software components (e.g. from component.java)
Skipping task ':generateMetadataFileForPluginNamePluginMarkerMavenPublication' as task onlyIf 'The publication is attached to a component' is false.Ryan Trontz
03/07/2024, 9:26 PMbuild.gradle file, the only difference is the plugin name and some dependencies, and it doesn’t have this issue.Vampire
03/07/2024, 9:49 PMVampire
03/07/2024, 9:50 PMVampire
03/07/2024, 9:50 PMVampire
03/07/2024, 9:50 PMVampire
03/07/2024, 9:51 PMmodule-maven-metadata.xml is generated by the AbstractMavenPublisher on the fly while publishing