-
Notifications
You must be signed in to change notification settings - Fork 6
Description
This shit job is very compilcated not hard, I feel it's totally necessary to make a record for this shit.
-
Get an account from Sonatype.
-
Request group-id by create an Issue
Project: Community Support - Open Source Project Repository Hosting (OSSRH) Issue Type: New Project -
Create a repo on github named with issue id
-
Create a library project using
Intellij IDEA -
Download GPG
-
Run
gpgcommands
gpg --full-generate-key
generates the key for signing your librarygpg --armor --export your-key-username
it prints public key in hex, copy & submit it to keyserver.ubuntu.com or keys.gnupg.net -
gpg --keyring key.gpg --export-secret-keys
it exports the key tokey.gpg, copy it to the root of library directorygpg --list-keys --keyid-format short
copy the short-key-id -
create a file named
gradle.propertiesin the root of library directory with content:
signing.keyId=short-key-id
signing.password=password
signing.secretKeyRingFile=key.gpg
- add this to the
build.gradle
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}
group 'io.github.hqktech'
version '1.0'
javadoc {
options {
encoding = "UTF-8"
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
maven {
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = username
password = password
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
groupId = 'io.github.hqktech'
name = 'jdwp'
description = 'A jdwp encoding & decoding library'
url = 'https://github.com/hqktech/jdwp'
developers {
developer {
id = 'LBJ-the-GOAT'
name = 'LBJ-the-GOAT'
email = 'LBJ-the-GOAT@hotmail.com'
}
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = 'scm:git:git@github.com:github.com/hqktech/jdwp.git'
developerConnection = 'scm:git:git@github.com:github.com/hqktech/jdwp.git'
url = 'https://github.com/hqktech/jdwp'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
repositories {
mavenCentral()
}
- Run this gradle, if successfully it will upload the jars to the OSSNH
- Go to (Nexus Repository Manager)[https://s01.oss.sonatype.org/] select the library just updated, close it & release it
- Go back to issue page of step 2 and ask for activate sync to maven central.
After 10 minutes after activated the library can be visited on repo1 maven and may be 2 hours later it's sync to Maven Central