task androidJavadocs(type: Javadoc) { failOnError = false source = android.sourceSets.main.java.srcDirs ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar" classpath += files(ext.androidJar) //将文档打包成jar task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { archiveClassifier.set('javadoc') from androidJavadocs.destinationDir //将源码打包 task androidSourcesJar(type: Jar) { archiveClassifier.set('sources') from android.sourceSets.main.java.srcDirs publishing { publicati 编写gradle脚本创建mavenpublish.gradle将module的build.gradle文件复制一份并重命名为mavenpublish.gradle在mavenpublish.gradle中添加如下代码apply plugin: 'maven-publish'//生成文档注释task androidJavadocs(type: Javadoc) { failOnError = false source = android.sourceSets.mai