Dependencies not added to the POM file - Android Gradle Maven Publishing

I am using the maven-publish plugin to publish aar file to the maven repository. However, I noticed that compilation dependencies are not added to pom.xml even after adding a transitive property. I am using com.android.tools.build: gradle: 1.1.3

Any clues on how to resolve this?

build.gradle

publishing { publications { sdkAar(MavenPublication) { artifacts { groupId 'com.test' artifactId 'my_sdk' version currentVersion artifact 'build/outputs/aar/release.aar' artifact androidJavadocsJar { classifier "javadoc" } } } sdkJar(MavenPublication) { groupId 'com.test' artifactId 'my_sdk_jar' version currentVersion artifact 'build/libs/release.jar' artifact androidJavadocsJar { classifier "javadoc" } } } repositories { maven { credentials { username archiva_username password archiva_password } } } } 

Thanks at Advance

+7
android android-gradle gradle
source share
1 answer

If you want dependencies to be added automatically to the POM, you need to use a component function. Here is an example from the user guide:

 publishing { publications { mavenJava(MavenPublication) { from components.java } } } 

This is important from ... What I do not know is whether the Android plugin is to configure its own software components. I do not see any references to such things.

Remember that the new publishing engine is currently being incubated, and perhaps that is why the Android plugin does not offer direct support for it at the moment.

If you really want to use the publish plugin, you can capture time-dependent artifacts and manually add them to the POM using the syntax described in the user guide . I would not recommend this approach, although it was erratic and looked prone to errors.

0
source share

All Articles