Note : Below step are assumes you Jira New Project ticket and thus a groupId.
- Create your library project.
- Create your github project and sync your local project with it.
- Copy build.gradle
- Copy-paste this into your local.properties file and modify as needed.
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=_TODO_SDK_PATH
ossrhUsername=_TODO_USERNAME
ossrhPassword=_TODO_PASSWORD
GROUP_ID=io.github.adityabavadekar
ARTIFACT_ID=mvn-sample
LIBRARY_PUBLIC_NAME=MVN Sample for Android Projects
LIBRARY_PUBLIC_DESCRIPTION=A concise description of my MVN-Sample library is that it is just a sample :) .
LIBRARY_GIT_URL=https://github.com/AdityaBavadekar/MVN-Sample
LIBRARY_INCEPTION_YEAR=2022
LIBRARY_LICENCE_NAME=The Apache License, Version 2.0
LIBRARY_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
LIBRARY_DEVELOPER_ID=AdityaBavadekar
LIBRARY_DEVELOPER_NAME=Aditya Bavadekar
LIBRARY_DEVELOPER_EMAIL=example@gmail.com
LIBRARY_SCM_CONNECTION=scm:git:git://github.com/mvn-sample.git
LIBRARY_SCM_URL=https://github.com/AdityaBavadekar/mvn-sample
- Use following commands:
>gpg --full-gen-key
# Copy last-8-DIGITS as KeyId.
>set keyId=PUT_YOUR_LAST_8_DIGITS
>cd mvn-sample # Or your project dir or some other dir where you want to save keyring.gpg
>gpg --export-secret-keys keyId > keyring.gpg # This will be PATH_TO_KEYRING_FILE
>gpg --keyserver keyserver.ubuntu.com --send-keys keyId # Requires network.
- Copy-paste this into gradle.properties (global)
#The keyId obtained in above step.
signing.keyId=YOUR_KEY_ID
#The password you used as passphrase while generating the GPG Key.
signing.password=PASSWORD
# Created in above step `gpg --export ...`
signing.secretKeyRingFile=PATH_TO_KEYRING_FILE
- Now your artifact will be in staging repositories.
- Go to https://s01.oss.sonatype.org/ and login with your credentials.
- Navigate to https://s01.oss.sonatype.org/#stagingRepositories
- Your artifact must be listed their. Eg:
io.github.adityabavadekar-1010
- Click on that artifact, select Activity and if everything worked their should be a green success message.
- In the top select Close. Wait till it completes.
- Then again select artifact and select Release. Wait for 10-15 min.
- Congratulations 🎊 you artifact is published.
Go to here and find you groupId.
- Gradle
implementation 'io.github.adityabavadekar:mvn-sample:TAG'
- Maven
<dependency>
<groupId>io.github.adityabavadekar</groupId>
<artifactId>mvn-sample</artifactId>
<version>TAG</version>
<type>aar</type>
</dependency>