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

后端 未结 5 1537
[愿得一人]
[愿得一人] 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:34

    There's an easier solution if you don't want to use a custom plugin. Instead, just recreate the install task with a different name. I called it installArchives. Add the following code to your build.gradle:

    task installArchives(type: Upload) {
        description "Installs the artifacts to the local Maven repository."
        repositories.mavenInstaller {
            configuration = configurations.default
            pom.groupId = 'my.group'
            pom.artifactId = 'my-artifact'
            pom.version = '1.0.0'
        }
    }
    

    You can now run gradle installArchives to install your aar locally.

提交回复
热议问题