https://github.com/lalakii/central-portal-plus
Publish your artifacts to sonatype's central portal. https://mavencentral.sourceforge.net
https://github.com/lalakii/central-portal-plus
gradle-plugin maven-central-portal maven-publish sonatype-central
Last synced: about 1 month ago
JSON representation
Publish your artifacts to sonatype's central portal. https://mavencentral.sourceforge.net
- Host: GitHub
- URL: https://github.com/lalakii/central-portal-plus
- Owner: lalakii
- License: apache-2.0
- Created: 2024-06-21T10:59:00.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-02-14T09:02:16.000Z (3 months ago)
- Last Synced: 2025-03-29T11:12:18.194Z (about 2 months ago)
- Topics: gradle-plugin, maven-central-portal, maven-publish, sonatype-central
- Language: Kotlin
- Homepage:
- Size: 43 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CentralPortalPlus
[](https://central.sonatype.com/artifact/cn.lalaki.central/central/)
[](https://app.codacy.com/gh/lalakii/central-portal-plus/dashboard)
[
](https://central.sonatype.com/artifact/cn.lalaki.central/central)
The plugin implements sonatype's [Central Publisher API](https://central.sonatype.com/api-doc) (part of).
It will call maven-publish to generate artifacts and publish them to [sonatype's central portal](https://central.sonatype.com/).
Note: This is a third party plugin.
## Usage
Apply this plugin in gradle:
```kts
plugins {
id("cn.lalaki.central") version "1.2.8"
}
```Add configuration:
```kts
val localMavenRepo = uri("path/of/local_repo") // The path is recommended to be set to an empty directory
centralPortalPlus {
url = localMavenRepo
// Configure user token.
username = "..."
password = "..."
// or load from xml file
tokenXml = uri("D:\\user_token.xml")
publishingType = PublishingType.USER_MANAGED // or PublishingType.AUTOMATIC
}
```( About "user_token.xml", save it to a file. )
![]()
Configure maven-publish as before, doc: [Maven Publish Plugin](https://docs.gradle.org/current/userguide/publishing_maven.html), or see: [sample/build.gradle.kts](https://github.com/lalakii/central-portal-plus/blob/master/sample/build.gradle.kts)
```kts
publishing {
repositories {
maven {
url = localMavenRepo // Specify the same local repo path in the configuration.
}
}
// ...
}
```
You are now ready to start the task of publishing to the Central Portal.
```console
# windows
.\gradlew publishToCentralPortal# other
./gradlew publishToCentralPortal
```
If you need to check the status of the deployment. (If no parameter is provided, the default value will be the last deployment Id)
```console
.\gradlew dumpDeployment -PutId="deployment Id"
```
If you want to remove the deployment. (If no parameter is provided, the default value will be the last deployment Id)
```console
.\gradlew deleteDeployment -PutId="deployment Id"
```
Note: deployments that have been successfully published cannot be deleted.If you need to get the deployment Id, visit: [Maven Central: Publishing](https://central.sonatype.com/publishing/deployments).
### End for now