Gradle Maven plugin “install” task does not work with Android library project

后端 未结 5 1538
[愿得一人]
[愿得一人] 2020-12-07 17:54

I want to install android library project to local maven repository. Here is build.gradle:

buildscript {
    repositories {
        mavenCentral()
          


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 18:31

    Elaborating on CyclingSir's answer, I propose to add a separate "installArchives" task. This should also take care of picking up your custom artifacts (e.g. sources).

    apply plugin: 'maven'
    
    task installArchives(type: Upload) {
      description "Installs the artifacts to the local Maven repository."
      configuration = configurations['archives']
      repositories {
        mavenDeployer {
          repository url: repositories.mavenLocal().url
        }
      }
    }
    

    Note that with Gradle Android plugin v0.5.5, gradle install still tries to install something on a device.

提交回复
热议问题