Skip to content

Commit

Permalink
#22 Publish to Sonatype instead of Bintray (which has been decommissi…
Browse files Browse the repository at this point in the history
…oned)
  • Loading branch information
nickmcdowall committed Apr 3, 2021
1 parent 0f7ad73 commit befa045
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 69 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

## Latest Release

| Bintray | Sonatype | Jitpack |
| ----------- | ----------- | ----------- |
| [![](https://api.bintray.com/packages/nickmcdowall/nkm/yatspec/images/download.svg)](https://bintray.com/nickmcdowall/nkm/yatspec/_latestVersion) | [![Maven Central](https://img.shields.io/maven-central/v/com.github.nickmcdowall/yatspec.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.nickmcdowall%22%20AND%20a:%22yatspec%22) | [![](https://jitpack.io/v/nickmcdowall/yatspec.svg)](https://jitpack.io/#nickmcdowall/yatspec) |
| Maven Central | Jitpack |
| -------- | ------- |
| [![Maven Central](https://img.shields.io/maven-central/v/com.github.nickmcdowall/yatspec.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.nickmcdowall%22%20AND%20a:%22yatspec%22) | [![](https://jitpack.io/v/nickmcdowall/yatspec.svg)](https://jitpack.io/#nickmcdowall/yatspec) |

## Overview
This project builds upon (and breaks away from) the excellent original [Yatspec](https://github.com/bodar/yatspec) project.
Expand All @@ -31,7 +31,6 @@ It focuses heavily on the **Sequence Diagram** capabilities of the framework for
````
// Any one of these repositories
repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
...
Expand Down Expand Up @@ -111,7 +110,7 @@ dependencies {
```

FYI Jitpack can be used as an alternative to jcenter() for latest releases too: [![](https://jitpack.io/v/nickmcdowall/yatspec.svg)](https://jitpack.io/#nickmcdowall/yatspec)
FYI Jitpack can be used as an alternative to mavenCentral() for latest releases too: [![](https://jitpack.io/v/nickmcdowall/yatspec.svg)](https://jitpack.io/#nickmcdowall/yatspec)

> Help my report output contains an error message instead of pretty sequence diagram
Expand Down
110 changes: 50 additions & 60 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id 'java-library'
id 'maven'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
id 'pl.allegro.tech.build.axion-release' version '1.10.0'
id "com.jfrog.bintray" version "1.8.5"
}

repositories {
Expand All @@ -14,30 +14,6 @@ group = 'com.github.nickmcdowall'
sourceCompatibility = '11'
project.version = scmVersion.version

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publications = ['MyPublication']
pkg {
repo = 'nkm'
name = 'yatspec'
override = false
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/nickmcdowall/yatspec.git'
publish = true
publicDownloadNumbers = true
issueTrackerUrl = 'https://github.com/nickmcdowall/yatspec/issues'
version {
released = new Date()
name = project.version
mavenCentralSync {
user = System.getenv('SONATYPE_USER')
password = System.getenv('SONATYPE_PASSWORD')
}
}
}
}

ext {
junitJupiter = '5.3.2'
junitPlatformVersion = '1.3.2'
Expand Down Expand Up @@ -71,7 +47,7 @@ dependencies {
testCompile 'org.assertj:assertj-core:3.15.0'

implementation "org.apache.commons:commons-lang3:3.11"

compileOnly 'org.projectlombok:lombok:1.18.16'
annotationProcessor 'org.projectlombok:lombok:1.18.16'
}
Expand All @@ -93,46 +69,60 @@ test {
}

wrapper {
gradleVersion = "5.3"
}

def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
name "Nick"
email "nicholas.mcdowall@gmail.com"
organization 'NKM IT Solutions'
organizationUrl 'https://github.com/nickmcdowall'
}
}
scm {
url "https://github.com/nickmcdowall/yatspec.git"
}
gradleVersion = "6.8.3"
}

publishing {
publications {
MyPublication(MavenPublication) {
mavenJava(MavenPublication) {
groupId = "$group"
artifactId = 'yatspec'
version = "${scmVersion.version}"

from components.java
artifact sourcesJar
artifact javadocJar
groupId "$group"
artifactId 'yatspec'
version "${scmVersion.version}"
pom.withXml {
def root = asNode()
root.appendNode('description', 'Yatspec living sequence diagrams')
root.appendNode('name', 'yatspec')
root.appendNode('url', 'https://github.com/nickmcdowall/yatspec.git')
root.children().last() + pomConfig
pom {
name = 'yatspec'
description = 'A library used in tests to generate living sequence diagrams'
url = 'https://github.com/nickmcdowall/yatspec.git'
licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}
developers {
developer {
name = "Nick"
email = "nicholas.mcdowall@gmail.com"
organization = 'NKM IT Solutions'
organizationUrl = 'https://github.com/nickmcdowall'
}
}
scm {
url = "https://github.com/nickmcdowall/yatspec.git"
}
}
repositories {
maven {
name = 'sonatype'
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials(PasswordCredentials)
}
}
}
}
}
}

nexusPublishing {
repositories {
sonatype {
}
}
}

signing {
sign publishing.publications.mavenJava
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e
# To bump the minor version use:
# ./gradlew marNextVersion -Prelease.incrementer=incrementMinor

# Bumpt patch version for release version by default
# Bump patch version for release version by default
./gradlew release

# Upload to bintray
./gradlew bintrayUpload
# Publish to sonatype and then release to maven central
./gradlew publishToSonatype closeAndReleaseStagingRepository

0 comments on commit befa045

Please sign in to comment.