To be used in conjunction of maven-publish
to correctly generate an AAR Pomfile.
For some reason, I can't get maven-publish
to generate a Pomfile when I'm exporting an Android library (AAR).
This plugin generates the Pomfile by looking at library's classpath and exclusions.
Just import this file somewhere on your project and on the library build.gradle
:
apply plugin: "maven-publish"
apply from: "$rootDir/scripts/maven-publish-pomfile-generation.gradle"
publishing {
repositories {
mavenLocal()
}
publications {
release(MavenPublication) {
groupId "me.borges"
artifactId "my_library"
version "1.0.0"
artifact "$buildDir/outputs/aar/my_library-release.aar"
pom.withXml pomfileManualGenerator
}
}
}
Then you can run:
./gradlew publishToMavenLocal