79833963

Date: 2025-11-30 14:33:53
Score: 1
Natty:
Report link

When you declare api project(':shared'), Gradle should expose it to consumers, but the default Maven Publish configuration doesn't automatically include these dependencies in the POM. Here's the fix:

Add this to your :library's build.gradle.kts inside the MavenPublication block:

pom {
    withXml {
        val dependenciesNode = asNode().getAt("dependencies")?.get(0)
            ?: asNode().appendNode("dependencies")

        configurations["releaseApiElements"].allDependencies
            .filter { it.group != null && it.name != "unspecified" }
            .forEach {
                val dependencyNode = dependenciesNode.appendNode("dependency")
                dependencyNode.appendNode("groupId", it.group)
                dependencyNode.appendNode("artifactId", it.name)
                dependencyNode.appendNode("version", it.version)
                dependencyNode.appendNode("scope", "compile")
            }
    }
}

Make sure :shared is also published to the same repository (JitPack). Your project structure requires publishing all modules independently – JitPack will handle building the full dependency tree if all modules are in the same Git repo.

Reasons:
  • Blacklisted phrase (1): thX
  • Long answer (-1):
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (1):
Posted by: Harbiger