I've created a library to use on most of our projects. So far, we've been using Github with Jitpack but our Jitpack subscription is expired and we've found an alternative way to upload the project elsewhere. We're using myMavenRepo for it. From this answer I was able to upload the project. However, there is a problem (which doesn't have an answer to include dependencies of the project itself.)
The project contains dependencies, and when we add this project into another project, the dependencies are not added. I'd like to figure out how to do that.
Here is my code:
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
}
publishing {
publications {
Repo(MavenPublication) {
groupId 'com.example.repo'
artifactId 'Repo'
version '1.3.7'
artifact(sourceJar)
artifact("$buildDir/outputs/aar/repo-release.aar")
}
}
repositories {
maven {
url "https://mymavenrepo.com/repo/repo_url/"
}
}
}
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 137
versionName "1.3.7"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation ("com.kochava.base:tracker:3.5.0") {
exclude group: "com.android.support"
}
implementation ("com.google.firebase:firebase-core:16.0.6") {
exclude group: "com.android.support"
}
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// Required: Install Referrer (If publishing to Google Play)
implementation 'com.android.installreferrer:installreferrer:1.0'
// Optional: Instant App Status Collection
implementation 'com.google.android.instantapps:instantapps:1.1.0'
// Required for Flurry Analytics integration
implementation 'com.flurry.android:analytics:11.4.0@aar'
// Crashlytics implementation.
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true
}
}
The publishing process is made with ./gradlew clean build publish
(I'm using ubuntu) and the publish is successful. From the read side of the repo, we're implementing it like this (after putting the maven URL to allprojects section):
implementation 'com.example.repo:Repo:1.3.7'
While the project itself is added, the inner dependencies such as Crashlytics, Flurry, Firebase Core etc. are not added. What should I do to make this library implement its own dependencies too? Any help is appreciated, thanks.