Closed PrasannaKumarChalla closed 4 years ago
Could you please provide the published pom.xml files? I think the cause of the problem is the use of different maven coordinates The Gradle will write the group and name of the project in the pom file when you add project('name')
to the dependencies
block. So, you should publish these project with the same coordinates. The easiest way if you do not define these coordinates, in this case the android-maven-publish
will use the project parameters for publishing.
The modified build.gradle file of ModuleC:
publishing {
repositories {
...
mavenLocal()
}
publications {
mavenSrcModuleC(MavenPublication) {
from components.android
}
}
}
I have an android project which includes 3 modules ModuleA, ModuleB, ModuleC. ModuleA depends on both ModuleB and ModuleC. I'm trying to publish the ModuleA to a maven repository using android-maven-publish plugin and looks like it is not automatically publishing ModuleB and ModuleC to maven when I run publishToMavenLocal. When I try to use published ModuleA as a dependency in a different project gradle could not resolve ModuleB, ModuleC.
Is there something that I am missing?.
I am using gradle plugin version 3.5.0, gradle version 5.4.1 and mavenPublishVersion 3.6.2.
This is how project's gradle looks like build.gradle(project)
and ModuleA's build.gradle build.gradle(ModuleA)
and ModuleB's build.gradle build.gradle(ModuleB)
and ModuleC's build.gradle build.gradle(ModuleC)