Android jcenter goes to maven and Nexus Public Libraries

Posted by NoName.ba on Sat, 16 Oct 2021 21:18:54 +0200

catalogue

background  

objective

to configure

achievements

Tutorial start

to configure

First of all, I'll give you an article on git configuration that is worth learning from

https://github.com/KVNR/appnexus_adserver_android/blob/4bf9cd5b7f7d0362dff92edfcde8e1d10b28ac2e/sdk/build.gradle

Then give you a blog worthy of reference

Remember to submit the dependency package org.sonatype.oss OSS OSS parent to maven central warehouse once_ Three swordsmen blog - CSDN blog

Just look at the above. If you really want to learn technology, you have to see your brother an's...

background  

Jcenter went bankrupt. The previous jcenter project was transferred to Nexus

objective

Publish library to: Nexus Repository Manager

to configure

First, make some conventional configurations. Although I don't know whether it works or not. Other people's blogs are finished.. I did it, too

achievements

//This is uploaded to the temporary warehouse.. I haven't finished uploading, but it's already very good for me...

Parent level   Build script under build.gradle and allprojects - repositories

quote

    maven {
            url "https://oss.sonatype.org/service/local/repositories/comanguomob-1000/content/"
        }

  Referenced in build.gradle of app module

 implementation 'com.anguomob:total:4.0.7'

Tutorial start

to configure

New file in parent directory  

maven-publish-snatype.gradle

The contents are as follows

apply plugin: "maven"

def username = [https://oss.sonatype.org login username]
def pwd = [https://oss.sonatype.org login pwd]
def nexusRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"

def VERSION_NAME = '4.0.7'
def ARTIFACT_ID = 'total'
def GROUP_ID = 'com.anguomob'

//Warehouse location https://oss.sonatype.org/index.html#view-repositories;comanguomob-1000~browsestorage~com.
uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: nexusRepositoryUrl) {
                authentication(userName: username, password: pwd)
            }
            pom.project {
                artifactId ARTIFACT_ID
                version VERSION_NAME
                groupId GROUP_ID
                packaging 'aar'
                description 'Multilingual'
                name "Total"
                url "https://wiki.appnexus.com/display/sdk/Mobile+SDKs?src=search#MobileSDKs-Android"
                scm {
                    connection "scm:git:git@github.com:appnexus/mobile-sdk-android.git"
                    developerConnection "scm:git:git@github.com:appnexus/mobile-sdk-android.git"
                    url "git@github.com:appnexus/mobile-sdk-android.git"
                }
                licenses {
                    license {
                        name "The Apache License, Version 2.0"
                        url "http://www.apache.org/licenses/LICENSE-2.0.txt"
                    }
                }
                developers {
                    developer {
                        name "anguo"
                        email "anguomob@163.com"
                        organizationUrl "https://www.anguomob.com/"
                    }
                }
            }
        }
    }
}

def username = [https://oss.sonatype.org login username]
def pwd = [https://oss.sonatype.org login pwd]
def nexusRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"

def VERSION_NAME = '4.0.7'
def ARTIFACT_ID = 'total'
def GROUP_ID = 'com.anguomob'

username and pwd should be configured   No, not good. Nexus repository URL I configure other people's warehouses.. I don't understand why I upload it. Many of the following configurations are also used. Other people's verification may not be so strict

Reference the above file

apply from: '../maven-publish-snatype.gradle'

  Then execute the gradle script in the sidebar and double-click to execute it

Then click here

Click and you will find.. Hey, I need to go backstage and order something

Background address: Nexus Repository Manager

Click here after logging in

Select and click close. Yes, select close... Then I will send you an email saying that there are no bug s in your code

This completes the configuration. It's simple

This is only configured to a temporary warehouse.. Not in the real warehouse yet. But if it's for us, it's enough. Ow

Topics: Android html5 Maven nexus