All Projects → marcphilipp → nexus-publish-plugin

marcphilipp / nexus-publish-plugin

Licence: Apache-2.0 license
⚠️ Deprecated - please switch to https://github.com/gradle-nexus/publish-plugin

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to nexus-publish-plugin

Reposilite
Lightweight repository management software dedicated for the Maven based artifacts (formerly NanoMaven) 📦
Stars: ✭ 222 (+484.21%)
Mutual labels:  gradle
Sponge
The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms.
Stars: ✭ 241 (+534.21%)
Mutual labels:  gradle
Autoarchive
一个基于Jenkins的iOS/Android自动构建系统,它实现了最大程度的自动化,让你的iOS自动打包,Android自动打包流程变得更加高效。此项目包含了各种实现细节的讲解说明,你能够使用它解决大多数跟客户端构建/分发相关的问题,并将这种能力进行开放,提高研发效率。
Stars: ✭ 248 (+552.63%)
Mutual labels:  gradle
Craftbook
🔧 Machines, ICs, PLCs, and more!
Stars: ✭ 226 (+494.74%)
Mutual labels:  gradle
Multilamp
Android library to showcase/highlight the multiple views on same overlay
Stars: ✭ 233 (+513.16%)
Mutual labels:  gradle
21 Points
❤️ 21-Points Health is an app you can use to monitor your health.
Stars: ✭ 244 (+542.11%)
Mutual labels:  gradle
Customfloatingactionbutton
This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button
Stars: ✭ 222 (+484.21%)
Mutual labels:  gradle
nexus-oss-on-aws
Deploy Sonatype Nexus Repository OSS on AWS with well architecture.
Stars: ✭ 51 (+34.21%)
Mutual labels:  nexus-repository-manager
Blindwatermark
Java 盲水印
Stars: ✭ 239 (+528.95%)
Mutual labels:  gradle
Grabredenvelope
微信抢红包Android APP
Stars: ✭ 245 (+544.74%)
Mutual labels:  gradle
Spring Petclinic Kotlin
Kotlin version of Spring Petclinic
Stars: ✭ 227 (+497.37%)
Mutual labels:  gradle
Templeapp
Android App which handles the information about temple. People can register and keep a track of all poojas, donations made to the temple.
Stars: ✭ 231 (+507.89%)
Mutual labels:  gradle
Gradle License Plugin
Gradle plugin that provides a task to generate a HTML license report of your project.
Stars: ✭ 246 (+547.37%)
Mutual labels:  gradle
Modularizationapp
Android 组件化demo
Stars: ✭ 226 (+494.74%)
Mutual labels:  gradle
Marathon
Cross-platform test runner written for Android and iOS projects
Stars: ✭ 250 (+557.89%)
Mutual labels:  gradle
Uportal
Enterprise open source portal built by and for the higher education community.
Stars: ✭ 221 (+481.58%)
Mutual labels:  gradle
Multimodulegithubclient
Example multi-module Android project with unit tests, dagger 2, test coverage and others
Stars: ✭ 244 (+542.11%)
Mutual labels:  gradle
publish-plugin
Gradle plugin for publishing to Nexus repositories
Stars: ✭ 243 (+539.47%)
Mutual labels:  nexus-repository-manager
Xpage
🔥A very useful Fragment page framework!(一个非常方便实用的fragment页面框架!)
Stars: ✭ 249 (+555.26%)
Mutual labels:  gradle
Globallydynamic
Dynamic Delivery everywhere through a common API
Stars: ✭ 248 (+552.63%)
Mutual labels:  gradle

Nexus Publish Plugin

Build Status Gradle Plugin Portal

Gradle Plugin that explicitly creates a Staging Repository before publishing to Nexus. This solves the problem that frequently occurs when uploading to Nexus from Travis, namely split staging repositories.

⚠️ Deprecation 🛑

This plugin is now deprecated and no longer maintained. The Gradle Nexus Publish Plugin is the successor of this plugin and adds additional tasks to close and release staging repositories.

Usage

The plugin does the following:

  • Apply the maven-publish plugin
  • configure a Maven artifact repository for each repository defined in the nexusPublishing { repositories { ... } } block
  • create a initialize${repository.name.capitalize()}StagingRepository task that starts a new staging repository in case the project's version does not end with -SNAPSHOT (customizable via the useStaging property) and sets the URL of the corresponding Maven artifact repository accordingly. In case of a multi-project build, all subprojects with the same nexusUrl will use the same staging repository.
  • if the io.codearte.nexus-staging plugin is applied on the root project, the stagingRepositoryId on its extension is set to the id of the newly created staging repository, this way it does not depend on exactly one open staging repository being available.
  • make all publishing tasks for each configured repository depend on the initialize${repository.name.capitalize()}StagingRepository task.
  • create a publishTo${repository.name.capitalize()} lifecycle task that depends on all publishing tasks for the corresponding Maven artifact repository.

Publishing to Maven Central via Sonatype OSSRH

In order to publish to Maven Central via Sonatype's OSSRH Nexus, you simply need to add the sonatype() repository like in the example below. It's nexusUrl and snapshotRepositoryUrl are pre-configured.

nexusPublishing {
    repositories {
        sonatype()
    }
}

In addition, you need to set the sonatypeUsername and sonatypePassword project properties, e.g. in ~/.gradle/gradle.properties. Alternatively, you can configure username and password in the sonatype block:

nexusPublishing {
    repositories {
        sonatype {
            username = "your-username"
            password = "your-password"
        }
    }
}

Finally, call publishToSonatype to publish all publications to Sonatype's OSSRH Nexus.

Full example

Groovy DSL

plugins {
    id "java-library"
    id "de.marcphilipp.nexus-publish" version "0.3.0"
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            from(components.java)
        }
    }
}

nexusPublishing {
    repositories {
        myNexus {
            nexusUrl = uri("https://your-server.com/staging")
            snapshotRepositoryUrl = uri("https://your-server.com/snapshots")
            username = "your-username" // defaults to project.properties["myNexusUsername"]
            password = "your-password" // defaults to project.properties["myNexusPassword"]
        }
    }
}

Kotlin DSL

plugins {
    `java-library`
    id("de.marcphilipp.nexus-publish") version "0.3.0"
}

publishing {
    publications {
        create<MavenPublication>("mavenJava") {
            from(components["java"])
        }
    }
}

nexusPublishing {
    repositories {
        create("myNexus") {
            nexusUrl.set(uri("https://your-server.com/staging"))
            snapshotRepositoryUrl.set(uri("https://your-server.com/snapshots"))
            username.set("your-username") // defaults to project.properties["myNexusUsername"]
            password.set("your-password") // defaults to project.properties["myNexusPassword"]
        }
    }
}

Integration with the Nexus Staging Plugin

If the io.codearte.nexus-staging plugin is applied on the root project, the following default values change:

Property Default value
packageGroup rootProject.nexusStaging.packageGroup
stagingProfileId rootProject.nexusStaging.stagingProfileId
username rootProject.nexusStaging.username
password rootProject.nexusStaging.password

This reuses the values specified for the nexusStaging block, so you don't have to specify them twice.

HTTP Timeouts

You can configure the connectTimeout and clientTimeout properties on the nexusPublishing extension to set the connect and read/write timeouts (both default to 1 minute). Good luck!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].