我正在创建一个 android 库,我基本上在使用
apply plugin: 'com.android.library'
apply plugin: 'digital.wup.android-maven-publish'
apply plugin: 'maven-publish'
publishing {
repositories {
maven {
url "...."
credentials(AwsCredentials) {
....
}
}
}
publications {
mavenAar(MavenPublication) {
.....
}
}
}
据我所知,这应该是创建一个名为“publishMavenAarToMavenRepository”的依赖任务,但我从“gradlew tasks”得到的只是以下内容:
Publishing tasks
----------------
generateMetadataFileForMavenAarPublication - Generates the Gradle metadata file for publication 'mavenAar'.
generatePomFileForMavenAarPublication - Generates the Maven POM file for publication 'mavenAar'.
publish - Publishes all publications produced by this project.
publishMavenAarPublicationToMavenLocal - Publishes Maven publication 'mavenAar' to the local Maven repository.
publishToMavenLocal - Publishes all Maven publications produced by this project to the local Maven cache.
我没有得到这样的任务,因此“发布”没有先决条件,并且成功执行,实际上什么都不做。这真是令人沮丧。我究竟做错了什么?插件的交互方式是否不好?我在 buildscript 和“digital.wup:android-maven-”中同时使用了“com.android.tools.build:gradle:3.3.0”和“com.android.tools.build:gradle:3.3.1”发布:3.6.2"。