0

I want to upload all of the cached dependency artifacts of my android project to Nexus Repository using gradle. Cached artifacts are in this path in windows:

C:\Users\<username>\.gradle\caches\modules-2\files-2.1

Here is my gradle configuration in the project build.gradle file:

plugins {
    id 'com.android.application' version '7.4.1' apply false
    id 'com.android.library' version '7.4.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
    id 'maven-publish'
    id 'java'
}

publishing{
    publications {
        mavenJava(MavenPublication) {
            groupId 'androidx.activity'
            artifactId 'activity'
            version '1.6.0'
            from components.java
        }
    }
    repositories {
        maven {
            credentials {
                username = "admin"
                password = "admin"
            }
            url = "http://localhost:8081/repository/hamkaran/"
            allowInsecureProtocol true
        }
    }
}

This configuration is just for uploading androidx.activity:activity:1.6.0 artifact. when I run .\gradlew publish command in terminal it uploads some files to Nexus but they are not actual artifact files. Here is an image of uploaded files:

enter image description here

But it should actually be like this:

enter image description here

The number and size of files are different and the aar file did not upload. How can I fix this and at the next level how can I upload all artifacts in files-2.1 folder to nexus using gradle?

Note: The Nexus installed locally

Squti
  • 4,171
  • 3
  • 10
  • 21

0 Answers0