Skip to content

Commit 08b65c0

Browse files
author
Jurgen
committed
Upgraded Gradle Maven plugin
1 parent 9a410d3 commit 08b65c0

1 file changed

Lines changed: 61 additions & 57 deletions

File tree

richtextfx/build.gradle

Lines changed: 61 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ buildscript {
66

77
plugins {
88
id 'org.unbroken-dome.test-sets' version '2.1.1'
9+
id 'osgi'
10+
id 'maven-publish'
11+
id 'signing'
912
}
1013

11-
apply plugin: 'osgi'
12-
apply plugin: 'maven'
13-
apply plugin: 'signing'
14-
1514
group = 'org.fxmisc.richtext'
1615

1716
testSets {
@@ -100,6 +99,10 @@ javadoc {
10099
'https://fxmisc.github.io/flowless/javadoc/0.6/',
101100
'https://fxmisc.github.io/wellbehaved/javadoc/0.3/'
102101
]
102+
103+
if(JavaVersion.current().isJava9Compatible()) {
104+
options.addBooleanOption('html5', true)
105+
}
103106
}
104107

105108
// use test logging.
@@ -187,66 +190,67 @@ artifacts {
187190
archives sourcesJar
188191
}
189192

190-
signing {
191-
sign configurations.archives
192-
}
193-
194-
signArchives.onlyIf {
195-
project.hasProperty('signing.keyId') && project.hasProperty('signing.password') && project.hasProperty('signing.secretKeyRingFile')
196-
}
197-
198193
def doUploadArchives = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
194+
publish.onlyIf { doUploadArchives }
199195

200196
if(doUploadArchives) {
201-
uploadArchives {
202-
repositories.mavenDeployer {
203-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
204-
205-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
206-
authentication(userName: sonatypeUsername, password: sonatypePassword)
197+
publishing {
198+
repositories {
199+
maven {
200+
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
201+
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
202+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
203+
credentials {
204+
username = "${sonatypeUsername}"
205+
password = "${sonatypePassword}"
206+
}
207+
}
208+
}
209+
publications {
210+
richTextFX(MavenPublication) {
211+
from components.java
212+
artifact sourcesJar
213+
artifact javadocJar
214+
pom {
215+
name = 'RichTextFX'
216+
packaging = 'jar'
217+
description = 'Rich-text area for JavaFX'
218+
url = 'https://github.com/FXMisc/RichTextFX/#richtextfx'
219+
220+
scm {
221+
url = 'scm:git@github.com:FXMisc/RichTextFX.git'
222+
connection = 'scm:git@github.com:FXMisc/RichTextFX.git'
223+
developerConnection = 'scm:git@github.com:FXMisc/RichTextFX.git'
224+
}
225+
226+
licenses {
227+
license {
228+
name = 'The BSD 2-Clause License'
229+
url = 'http://opensource.org/licenses/BSD-2-Clause'
230+
distribution = 'repo'
231+
}
232+
license {
233+
name = 'GPLv2 with the Classpath Exception'
234+
url = 'http://www.gnu.org/software/classpath/license.html'
235+
distribution = 'repo'
236+
}
237+
}
238+
239+
developers {
240+
developer {
241+
name = 'Tomas Mikula'
242+
}
243+
}
244+
}
207245
}
208-
209-
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
210-
authentication(userName: sonatypeUsername, password: sonatypePassword)
211-
}
212-
213-
pom.project {
214-
name 'RichTextFX'
215-
packaging 'jar'
216-
description 'Rich-text area for JavaFX'
217-
url 'https://github.com/FXMisc/RichTextFX/#richtextfx'
218-
219-
scm {
220-
url 'scm:git@github.com:FXMisc/RichTextFX.git'
221-
connection 'scm:git@github.com:FXMisc/RichTextFX.git'
222-
developerConnection 'scm:git@github.com:FXMisc/RichTextFX.git'
223-
}
224-
225-
licenses {
226-
license {
227-
name 'The BSD 2-Clause License'
228-
url 'http://opensource.org/licenses/BSD-2-Clause'
229-
distribution 'repo'
230-
}
231-
license {
232-
name 'GPLv2 with the Classpath Exception'
233-
url 'http://www.gnu.org/software/classpath/license.html'
234-
distribution 'repo'
235-
}
236-
}
237-
238-
developers {
239-
developer {
240-
name 'Tomas Mikula'
241-
}
242-
}
243-
}
244-
}
246+
}
247+
}
248+
249+
signing {
250+
sign publishing.publications.richTextFX
245251
}
246252
}
247253

248-
uploadArchives.onlyIf { doUploadArchives }
249-
250254
task fatJar(type: Jar, dependsOn: classes) {
251255
appendix = 'fat'
252256
manifest.attributes( 'Automatic-Module-Name': 'org.fxmisc.richtext', 'Multi-Release': 'true' )

0 commit comments

Comments
 (0)