How to download aar library in Nexus?

I have an Android aar library that I use with an Android app. It works correctly with the aar library included directly in the Android project. I would like to move this library to my internal Nexus maven repository so that other developers can use the library too.

How to load aar into Nexus (Maven repository)? There is no obvious possibility in the web interface:

Nexus web interface

+4
source share
6 answers

I used the gradle maven plugin to boot into Nexus by modifying the Android build.gradle file.

apply plugin: 'maven'

dependencies {
    deployerJars "org.apache.maven.wagon:wagon-http:2.2"
}

uploadArchives {
    repositories.mavenDeployer {
        configuration = configurations.deployerJars
        repository(url: "https://my.example.com/content/repositories/com.example/") {
            authentication(userName: "exampleUser", password: "examplePassword")
            pom.groupId = "com.example"
            pom.artifactId = "myexample"
            pom.version = '1.0.0'
        }
    }
}

: gradlew upload, gradlew script, Android Studio.

, .

+5

maven. :

mvn deploy

, pom.xml distributonManagement, , Nexus repo

, pom.xml, , , pom.xml, Nexus, ,

mvn deploy:deploy-file -Durl=http://mycompany/nexus/repo/blah -Dfile=/path/to/my/foo.aar -Dpackaging=aar -DgroupId=com.mycompany -DartifactId=foo -Dversion=1.2.3

maven deploy plugin doc : https://maven.apache.org/plugins/maven-deploy-plugin/

+3

Android build.gradle, , - :

app/
---build.gradle
---module/
------build.gradle

app/build.gradle :

repositories {
    jcenter()
    maven {
            url "http://localhost:8081/repository/test-maven-repo/"
        }
}

//build.gradle :

apply plugin: 'maven'

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "http://localhost:8081/repository/test-maven-repo/") {
                authentication(userName: "admin", password: "admin123")
                pom.groupId = "com.example.test"
                pom.artifactId = "myexample.test"
                pom.version = '1.0.0'
            }
        }
    }
}

:

./gradlew upload

: http://zserge.com/blog/gradle-maven-publish.html

+3

Gradle, Nexus:

https://medium.com/@scottyab/how-to-publish-your-open-source-library-to-maven-central-5178d9579c5#.acynm6j49

, Gradle (uploadArchives), . , - :

>gradle clean build uploadArchives
+2
source

You can download it using Maven or Gradle or manually.

For manual downloads, you can simply enter the package value in the input, which should be "aar", and download as you wish.

+1
source

It makes no sense why the nexus package has nothing for the @aar file, but if you try to download it as a jar, it will not block you, and everything will work as it is.

+1
source

Source: https://habr.com/ru/post/1628657/


All Articles