Menu

Tree [02bc6a] master /
 History

HTTPS access


File Date Author Commit
 central 2025-02-14 lalakii lalakii [02bc6a] :white_check_mark: v1.2.8 - fix deprecated
 gradle 2025-02-14 lalakii lalakii [02bc6a] :white_check_mark: v1.2.8 - fix deprecated
 sample 2025-01-15 lalakii lalakii [19cf12] v1.2.6 support load token from xml & updating d...
 .gitignore 2024-06-27 lalakii lalakii [9486c6] v1.2.5
 LICENSE 2024-06-27 lalakii lalakii [9486c6] v1.2.5
 README.md 2025-02-14 lalakii lalakii [02bc6a] :white_check_mark: v1.2.8 - fix deprecated
 build.gradle.kts 2024-06-27 lalakii lalakii [9486c6] v1.2.5
 gradle.properties 2025-02-14 lalakii lalakii [02bc6a] :white_check_mark: v1.2.8 - fix deprecated
 icon.png 2025-02-02 lalakii lalakii [7aad02] :memo: v1.2.7 - add icon
 settings.gradle.kts 2025-02-02 lalakii lalakii [ae0f5b] :memo: v1.2.7 - update dependencies and xml rea...

Read Me

CentralPortalPlus

Maven Central
Codacy Badge
License: Apache-2.0 (shields.io)

CentralPortalPlus

The plugin implements sonatype's Central Publisher API (part of).

It will call maven-publish to generate artifacts and publish them to sonatype's central portal.

Note: This is a third party plugin.

Usage

Apply this plugin in gradle:

plugins {
    id("cn.lalaki.central") version "1.2.8"
}

Add configuration:

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. )

tokenXml

Configure maven-publish as before, doc: Maven Publish Plugin, or see: sample/build.gradle.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.

# 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)

.\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)

.\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.

End for now

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.