1
1
import org.gradle.internal.os.OperatingSystem
2
2
3
3
plugins {
4
+ id ' java'
4
5
id ' java-library'
5
6
id ' maven-publish'
6
7
id ' jacoco'
24
25
toolchain {
25
26
languageVersion = JavaLanguageVersion . of(21 )
26
27
}
27
- withJavadocJar()
28
- withSourcesJar()
29
28
}
30
29
31
30
repositories {
@@ -71,6 +70,31 @@ javadoc {
71
70
}
72
71
}
73
72
73
+ tasks. register(' javadocJar' , Jar ) {
74
+ classifier = ' javadoc'
75
+ from javadoc
76
+ }
77
+
78
+ tasks. register(' sourcesJar' , Jar ) {
79
+ classifier = ' sources'
80
+ from sourceSets. main. allSource
81
+ }
82
+
83
+ jacoco {
84
+ toolVersion = " 0.8.13"
85
+ }
86
+
87
+ jacocoTestReport {
88
+ reports {
89
+ xml. enabled = true // coveralls plugin depends on xml format report
90
+ html. enabled = true
91
+ }
92
+ }
93
+
94
+ artifacts {
95
+ archives javadocJar, sourcesJar
96
+ }
97
+
74
98
if (isMerge || isRelease) {
75
99
nexusPublishing {
76
100
repositories {
@@ -87,18 +111,14 @@ if (isMerge || isRelease) {
87
111
publishing {
88
112
publications {
89
113
mavenJava(MavenPublication ) {
90
- artifactId = archivesBaseName
91
114
from components. java
92
- versionMapping {
93
- usage(' java-api' ) {
94
- fromResolutionOf(' runtimeClasspath' )
95
- }
96
- usage(' java-runtime' ) {
97
- fromResolutionResult()
98
- }
99
- }
115
+ artifact sourcesJar
116
+ artifact javadocJar
100
117
pom {
101
- name = ' JNats Json'
118
+ name = rootProject. name
119
+ packaging = ' jar'
120
+ groupId = group
121
+ artifactId = archivesBaseName
102
122
description = ' JSON Parser built specifically for JNATS'
103
123
url = ' https://github.com/nats-io/nats.java.json'
104
124
licenses {
@@ -112,7 +132,7 @@ publishing {
112
132
id = " synadia"
113
133
name = " Synadia"
114
134
email = " info@synadia.com"
115
- url = " https://synadia .io"
135
+ url = " https://nats .io"
116
136
}
117
137
}
118
138
scm {
@@ -121,14 +141,6 @@ publishing {
121
141
}
122
142
}
123
143
}
124
- // repositories {
125
- // maven {
126
- // // change URLs to point to your repos, e.g. http://my.org/repo
127
- // def releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/"
128
- // def snapshotsRepoUrl = layout.buildDirectory.dir("https://central.sonatype.com/repository/maven-snapshots/")
129
- // url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
130
- // }
131
- // }
132
144
}
133
145
134
146
if (isRelease) {
0 commit comments