Publish an Android library to Maven with aar and source jar

后端 未结 5 1958
情深已故
情深已故 2020-11-28 02:30

Can somebody give me a hint on how to use the maven-publish gradle plugin to publish a com.android.library project/module with aar and source jar?

5条回答
  •  再見小時候
    2020-11-28 03:07

    If you want to avoid boilerplate codes, because the maven-publish plugin do not write dependencies into pom.xml

    Try this plugin: android-maven-publish

    publishing {
        publications {
            mavenAar(MavenPublication) {
                groupId 'com.example'
                artifactId 'mylibrary'
                version '1.0.0'
                from components.android
            }
        }
    
        repositories {
            maven {
                url "$buildDir/releases"
            }
        }
    }
    

提交回复
热议问题