Thanks Xavier.
I have converted over to the older-style maven plugin for now and I have successfully built and deployed to my Maven repository over the network. Here is what my new configuration looks like:
uploadArchives {
repositories.mavenDeployer {
authentication(userName: "${artifactory_user}", password: "${artifactory_password}")
}}}
task sourceJar(type: Jar) {
from android.sourceSets.main.java
classifier "sources"
}
artifacts {
archives(sourceJar)
}
Now I have a couple of additional questions.
1) Does Gradle/Android Studio support downloading attached sources from Maven for an Android Library (AAR) project? I was able to successfully upload an <artifact>-<version>-sources.jar file to Artifactory as above and it sits alongside the .aar file just like it would for a normal JAR deployment, but I don't see Gradle making any attempt to download it and therefore when I click through to a class referenced from the library project, I have to manually attach source in Android Studio. It also seems like the above approach isn't very resilient for supporting non-Java source files like resources, so wondering if there is a preferred approach.
2) I was depending on the Gradle task 'publishToMavenLocal' when using the maven-publish plugin, but for the normal 'maven' plugin, the documentation says to use the 'install' task to install to maven local (~/.m2). This task name gets clobbered by the android plugin so when I do 'gradle install' I end up running the install to device task versus the maven task. I found a few old posts where someone had encountered conflicting Gradle task names and it doesn't look like there's a simple workaround for that. Any suggestions as to what to do here?