1

I'm creating an android library and I'm basically using

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) {
          .....
    }
  }
}

From what I can gather this should be creating a dependent task called "publishMavenAarToMavenRepository" but all I get from "gradlew tasks" is the following:

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.

I get no such task, and therefore "publish" has no prerequisites, and executes with success, effectively doing nothing. This is really frustrating. What am I doing wrong? Are the plugins interacting in a bad way? I have used both "com.android.tools.build:gradle:3.3.0" and "com.android.tools.build:gradle:3.3.1" for this in the buildscript and "digital.wup:android-maven-publish:3.6.2".

Dr. Polar Humenn
  • 377
  • 3
  • 10

1 Answers1

2

Ugg. This is an evaluation problem. I originally had the outer build.gradle file have the following:

allprojects {
     apply plugin: "maven-publish"
}
publishing {
  repositories {
    maven {
        .....
    }
  }
}

while having the inner build.gradle file

publishing { 
  publications {
    mavenAar(MavenPublication) {
         ....
    }
  }
}

And that folks, doesn't appear to work.

Dr. Polar Humenn
  • 377
  • 3
  • 10