Languages: 中文文档 | English
Medivh-publisher is a Gradle plugin designed to publish Gradle projects to the Maven Central Repository. This plugin allows you to perform a complete publication without needing to consult any official documentation.
There are two private configurations that every publisher must have.
-
Sonatype Token 📄 - This is a username and password that is used to authenticate the user when uploading the artifacts to the Maven Central Repository.
-
GPG 🔑 - This is a private key that is used to sign the artifacts that are uploaded to the Maven Central Repository.
Please ensure that you have the required configurations before proceeding. This means that you can get five attributes from gradle. - signing.keyId - signing.password - signing.secretKeyRingFile - sonatypeUsername - sonatypePassword
In your build.gradle.kts
file, add the following code:
plugins {
id("tech.medivh.plugin.publisher") version "1.0.0"
// other plugin ...
}
😺 That’s right, you read that correctly.
Other than tech.medivh.plugin.publisher
, you don’t need to include any other plugins.
Open your terminal and execute:
./gradlew uploadToSonatype
😺 Exactly, you don’t even need any configuration.
You will see the following output in Sonatype:
For more advanced configurations and principles, see the Document