I have a Gradle project I\'m using the maven-publisher plugin to install my android library to maven local and a maven repo.
That works, but the g
Kotlin DSL version of the accepted answer:
create("maven") {
groupId = "com.example"
artifactId = "sdk"
version = Versions.sdkVersionName
artifact("$buildDir/outputs/aar/Example-release.aar")
pom.withXml {
val dependenciesNode = asNode().appendNode("dependencies")
val configurationNames = arrayOf("implementation", "api")
configurationNames.forEach { configurationName ->
configurations[configurationName].allDependencies.forEach {
if (it.group != null) {
val dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
dependencyNode.appendNode("version", it.version)
}
}
}
}
}