Skip to content

Commit 9d4b766

Browse files
committed
Update to support Java 21
* Upgrade gradle to 8.14 * Fix running under Java 21
1 parent a325b6b commit 9d4b766

22 files changed

+607
-344
lines changed

build.gradle

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
import org.gradle.internal.os.OperatingSystem
2-
31
plugins {
4-
id 'java'
5-
id 'java-library'
6-
id 'maven-publish'
7-
id 'jacoco'
8-
id 'com.github.kt3k.coveralls' version '2.12.0'
9-
id "org.gradle.test-retry" version "1.1.9"
10-
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
11-
id 'signing'
2+
id("java")
3+
id("java-library")
4+
id("maven-publish")
5+
id("jacoco")
6+
id("biz.aQute.bnd.builder") version "7.1.0"
7+
id("org.gradle.test-retry") version "1.6.4"
8+
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
9+
id("signing")
1210
}
1311

14-
def jarVersion = "2.0.2"
12+
def jarVersion = "2.1.0"
1513
group = 'io.nats'
1614

1715
def isMerge = System.getenv("BUILD_EVENT") == "push"
@@ -27,12 +25,11 @@ java {
2725

2826
repositories {
2927
mavenCentral()
30-
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
28+
maven { url="https://oss.sonatype.org/content/repositories/releases/" }
3129
}
3230

3331
dependencies {
3432
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.0'
35-
testImplementation 'com.github.stefanbirkner:system-lambda:1.2.1'
3633
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.12.3'
3734
}
3835

@@ -45,41 +42,30 @@ javadoc {
4542
source = sourceSets.main.allJava
4643
title = "NATS.IO Java Server Runner"
4744
classpath = sourceSets.main.runtimeClasspath
48-
doLast {
49-
if (!OperatingSystem.current().isWindows()) {
50-
exec {
51-
println "Updating favicon on all html files"
52-
workingDir 'build/docs/javadoc'
53-
// Only on linux, mac at this point
54-
commandLine 'find', '.', '-name', '*.html', '-exec', 'sed', '-i', '-e', 's#<head>#<head><link rel="icon" type="image/ico" href="favicon.ico">#', '{}', ';'
55-
}
56-
copy {
57-
println "Copying images to javadoc folder"
58-
from 'src/main/javadoc/images'
59-
into 'build/docs/javadoc'
60-
}
61-
}
62-
}
6345
}
6446

65-
task javadocJar(type: Jar) {
47+
tasks.register('javadocJar', Jar) {
6648
archiveClassifier.set('javadoc')
6749
from javadoc
6850
}
6951

70-
task sourcesJar(type: Jar) {
52+
tasks.register('sourcesJar', Jar) {
7153
archiveClassifier.set('sources')
7254
from sourceSets.main.allSource
7355
}
7456

57+
artifacts {
58+
archives javadocJar, sourcesJar
59+
}
60+
7561
jacoco {
76-
toolVersion = "0.8.6"
62+
toolVersion = "0.8.12"
7763
}
7864

7965
jacocoTestReport {
8066
reports {
81-
xml.enabled = true // coveralls plugin depends on xml format report
82-
html.enabled = true
67+
xml.required = true // coveralls plugin depends on xml format report
68+
html.required = true
8369
}
8470
afterEvaluate { // only report on main library not examples
8571
classDirectories.setFrom(files(classDirectories.files.collect {
@@ -89,10 +75,6 @@ jacocoTestReport {
8975
}
9076
}
9177

92-
artifacts {
93-
archives javadocJar, sourcesJar
94-
}
95-
9678
if (isMerge || isRelease) {
9779
nexusPublishing {
9880
repositories {
@@ -113,11 +95,11 @@ publishing {
11395
artifact sourcesJar
11496
artifact javadocJar
11597
pom {
116-
name = rootProject.name
117-
packaging = 'jar'
98+
name = "jnats-server-runner"
99+
packaging = "jar"
118100
groupId = group
119-
artifactId = archivesBaseName
120-
description = 'Java NATS.io server runner.'
101+
artifactId = "jnats-server-runner"
102+
description = "Java NATS.io server runner."
121103
url = 'https://github.com/nats-io/java-nats-server-runner'
122104
licenses {
123105
license {

gradle/wrapper/gradle-wrapper.jar

-57.3 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)