vanniktech/gradle-maven-publish-plugin

Dependency version information is missing

fenggit opened this issue · 4 comments

After successfully publishing Android to Maven Central, the Maven Central backend prompts that Dependency version information is missing. How should I configure it?

image

I also set:coordinates("io.github.test1233", "MyTest", "1.0.0")

My workaround is by adding the versions explicitly to all my library dependencies

implementation("androidx.compose.ui")
// update to 
implementation("androidx.compose.ui:1.6.8")

I spent an entire day hunting down a similar issue. I had specified all of my dependency versions, but the Jetpack Compose libs were controlled by a gradle platform + BOM package.

Turns out this package isn't available on Maven Central. So I had to add the Google repository manually to the pom builder. I don't know why there isn't a helper in the DSL for this, but I had to resort to hand coding. Here's what it looks like:

pom {
  // ...
  withXml {
    def repo = asNode().appendNode('repositories').appendNode('repository')
    repo.appendNode('name', 'Google')
    repo.appendNode('id', 'google')
    repo.appendNode('url', ' https://maven.google.com/')
  }
}

@ianthetechie Thank you so much for the solution, it worked perfectly for me.