0

My project is an old android application (module-front) with modules (module-shared) that used to be published on maven. I have an access to source code of the module and I want to store my module in my mavenLocal. My directory structure :

/project
    /module-front
        build.gradle
    /module-shared
        build.gradle
    build.gradle

My module-front gradle file has a dependency on the published (but removed) module-shared :

apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
    // Android properties here
}

dependencies {
    ext {/* Versions here */}

    compile group: 'module-shared group', name: 'module-shared name', version: moduleSharedVersion

    // compile and testCompile here
}

repositories {
    mavenLocal()
    jcenter()
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}

apt {
    // apt here
}

ModuleSharedVersion is defined in my root gradle file :

buildscript {
    repositories {
        mavenLocal()
        jcenter()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    }

}

allprojects {
    ext {
        moduleSharedVersion= '2.1'
    }
    version = '1.4.8h'
    group = 'myGroup'
}

Problem starts here: Now I want my module-shared to be stored in mavenLocal so my module-front might access it :

apply plugin: 'application'
apply plugin: 'maven'

version = '2.1'

uploadArchives {
    repositories {
        mavenInstaller {
            repository(url: mavenLocal().url)
            pom.groupId = 'module-shared group'
            pom.artifactId = 'module-shared name'
            pom.version = version
        }
    }
}

repositories {
    mavenLocal()
    jcenter()
    mavenCentral()
}

This is my attempt to store it in mavenLocal inspired from multiple posts (example) which doesn't work... I don't know much about gradle, not enough to fix it tbh.

Please tell me if you need any other file that might be important to understand/answer. Thanks :)

IQbrod
  • 2,060
  • 1
  • 6
  • 28

0 Answers0