Skip to content

Commit

Permalink
Updated gradle maven plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen committed Feb 24, 2021
1 parent dd78739 commit 164e3d0
Showing 1 changed file with 49 additions and 65 deletions.
114 changes: 49 additions & 65 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
buildscript {
repositories {
mavenCentral()
// Needed only for SNAPSHOT versions
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
}
}

version = '0.6.2-SNAPSHOT'
version = '0.6.4-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'osgi'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'io.codearte.nexus-staging'

buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.7.1'
}
}

repositories {
Expand Down Expand Up @@ -89,69 +73,69 @@ artifacts {
archives sourcesJar
}

signing {
sign configurations.archives
}

signArchives.onlyIf {
project.hasProperty('signing.keyId') && project.hasProperty('signing.password') && project.hasProperty('signing.secretKeyRingFile')
}

def doUploadArchives = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
publish.onlyIf { doUploadArchives }

if(doUploadArchives) {
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

pom.project {
name 'Flowless'
description 'Efficient VirtualFlow for JavaFX.'
url 'http://www.fxmisc.org/flowless/'
packaging 'jar'
licenses {
license {
name 'The BSD 2-Clause License'
url 'http://opensource.org/licenses/BSD-2-Clause'
distribution 'repo'
}
}
scm {
url 'scm:git@github.com:FXMisc/Flowless.git'
connection 'scm:git@github.com:FXMisc/Flowless.git'
developerConnection 'scm:git@github.com:FXMisc/Flowless.git'
publishing {
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = "${sonatypeUsername}"
password = "${sonatypePassword}"
}
developers {
developer {
name 'Tomas Mikula'
}
}
publications {
flowless(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'flowless'
packaging = 'jar'
description = 'Efficient VirtualFlow for JavaFX.'
url = 'https://github.com/FXMisc/Flowless/#flowless'

scm {
url = 'scm:git@github.com:FXMisc/flowless.git'
connection = 'scm:git@github.com:FXMisc/Flowless.git'
developerConnection = 'scm:git@github.com:FXMisc/Flowless.git'
}
developer {
name 'Jordan Martinez'

licenses {
license {
name = 'The BSD 2-Clause License'
url = 'http://opensource.org/licenses/BSD-2-Clause'
distribution = 'repo'
}
}

developers {
developer {
name = 'Tomas Mikula'
}
developer {
name = 'Jordan Martinez'
}
}
}
}
}
}

signing {
sign publishing.publications.flowless
}
}

uploadArchives.onlyIf { doUploadArchives }

assemble.dependsOn fatJar

task getVersion {
doLast {
println version
}
}

nexusStaging {
packageGroup = "org.fxmisc.flowless"
}

0 comments on commit 164e3d0

Please sign in to comment.