Git Product home page Git Product logo

sonatypecentralupload's Introduction

SonatypeCentralUpload

This is an unofficial gradle plugin to upload artifacts to Sonatype Central Repository.

Usage

1. Add the plugin to your buildscript

Groovy:

plugins {
    id 'cl.franciscosolis.sonatype-central-upload' version '1.0.3'
}

Kotlin:

plugins {
    id("cl.franciscosolis.sonatype-central-upload") version "1.0.3"
}

Here's the id for quick copy-paste (yup I also struggle with this):

cl.franciscosolis.sonatype-central-upload

2. Configure the plugin

Groovy:

sonatypeCentralUpload {
    username = "your-username"                      // This is your Sonatype generated username
    password = "your-password"                      // This is your sonatype generated password
    
    archives = files(/*...*/)                       // This is a list of files to upload. Ideally you would point to your jar file, source and javadoc jar (required by Central)
    pom = file("path/to/pom.xml")                   // This is the pom file to upload. This is required by Central
    
    signingKey = "--BEGIN PGP PRIVATE KEY BLOCK--"  // This is your PGP private key. This is required to sign your files
    signingKeyPassphrase = "..."                    // This is your PGP private key passphrase (optional) to decrypt your private key
    publicKey = "--BEGIN PGP PUBLIC KEY BLOCK--"    // This is your PGP public key (optional). To distribute later to verify your deployments.

    publishingType = "AUTOMATIC"                    // This is the publishing strategy (optional). By default, the plugin automatically publishes the jar to Central. The possible values are: AUTOMATIC (default) or MANUAL.
}

Kotlin:

sonatypeCentralUpload {
    username = "your-username"                         // This is your Sonatype generated username
    password = "your-password"                         // This is your sonatype generated password
    
    archives = files(/*...*/)                          // This is a list of files to upload. Ideally you would point to your jar file, source and javadoc jar (required by Central)
    pom = file("path/to/pom.xml")                      // This is the pom file to upload. This is required by Central
    
    signingKey = "--BEGIN PGP PRIVATE KEY BLOCK--"     // This is your PGP private key. This is required to sign your files
    signingKeyPassphrase = "..."                       // This is your PGP private key passphrase (optional) to decrypt your private key
    publicKey = "--BEGIN PGP PUBLIC KEY BLOCK--"       // This is your PGP public key (optional). To distribute later to verify your deployments.

    publishingType = "AUTOMATIC"                       // This is the publishing strategy (optional). By default, the plugin automatically publishes the jar to Central. The possible values are: AUTOMATIC (default) or MANUAL.
}

3. Run the task

./gradlew sonatypeCentralUpload

License

This project is licensed under the GNU GPLv3 License - see the LICENSE file for details

sonatypecentralupload's People

Contributors

eriksencosta avatar im-fran avatar sullis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sonatypecentralupload's Issues

Android Project

I am trying to upload an android library to maven central. I am not sure what to put in archives = files( ????)

Thanks in advance

class org.gradle.initialization.DefaultSettings_Decorated cannot be cast to class org.gradle.api.Project

I'm sorry if I'm doing something stupid, this is my first time using a Gradle plugin.
I inherited a project that used the legacy oss.sonatype.org system (for which we no longer have credentials), and wanted to use your plugin with our new Central Portal credentials.

I think I followed your instructions, but whenever I run ./gradlew I get:

An exception occurred applying plugin request [id: 'cl.franciscosolis.sonatype-central-upload', version: '1.0.3']
> Failed to apply plugin 'cl.franciscosolis.sonatype-central-upload'.
   > class org.gradle.initialization.DefaultSettings_Decorated cannot be cast to class org.gradle.api.Project (org.gradle.initialization.DefaultSettings_Decorated and org.gradle.api.Project are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @3d012ddd)

Any suggestions? The actual code is here:
quiltdata/quiltcore-java#11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.