Skip to content

Commit 9ca8812

Browse files
committed
Long due 1.6 release containing relevant pull requests since ~2018. Updated the build system a bit as well
1 parent 13e9a2f commit 9ca8812

File tree

16 files changed

+316
-332
lines changed

16 files changed

+316
-332
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ build/
88
### Maven template
99
### Eclipse template
1010
.gradle
11+
gradle.properties
1112
tmp/
1213
# Eclipse Core
1314
# External tool builders
@@ -25,4 +26,5 @@ tmp/
2526
/bin/
2627
/.nb-gradle/
2728
/target
28-
out/
29+
out/
30+
.DS_Store

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@ using maven:
3838
In `<dependencies>`:
3939

4040
```xml
41-
4241
<!-- jsonrpc4j -->
4342
<dependency>
4443
<groupId>com.github.briandilley.jsonrpc4j</groupId>
4544
<artifactId>jsonrpc4j</artifactId>
46-
<version>1.5.3</version>
45+
<version>1.6</version>
4746
</dependency>
47+
```
48+
49+
or with gradle:
4850

51+
```groovy
52+
implementation('com.github.briandilley.jsonrpc4j:jsonrpc4j:1.6')
4953
```
5054

5155
If you want to just download the projects output JAR and it's dependencies you can

build.gradle

Lines changed: 102 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,45 @@
1+
buildscript {
2+
3+
ext {
4+
set("jacksonVersion", "2.10.2")
5+
set("springVersion", "4.3.26.RELEASE")
6+
set("springBotVersion", "1.4.7.RELEASE")
7+
set("jettyVersion", "9.4.0.RC3")
8+
set("slf4jVersion", "1.7.30")
9+
}
10+
11+
repositories {
12+
gradlePluginPortal()
13+
mavenCentral()
14+
jcenter()
15+
maven { url "https://plugins.gradle.org/m2/" }
16+
}
17+
18+
dependencies {
19+
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3"
20+
classpath("com.adarshr:gradle-test-logger-plugin:1.6.0")
21+
}
22+
}
23+
124
plugins {
2-
id 'java'
3-
id 'nebula.optional-base' version '3.1.0'
4-
id 'nebula.provided-base' version '3.1.0'
5-
id 'findbugs'
6-
id 'pmd'
7-
id 'jacoco'
8-
id 'nebula.info' version '3.4.1'
9-
id 'com.github.ben-manes.versions' version '0.13.0'
10-
id 'osgi'
11-
id 'maven-publish'
12-
id 'nebula.nebula-javadoc-jar' version '2.2.2'
13-
id 'nebula.nebula-source-jar' version '2.2.2'
14-
id 'com.jfrog.bintray' version '1.7.3'
25+
id('jacoco')
26+
}
27+
28+
repositories {
29+
mavenLocal()
30+
gradlePluginPortal()
31+
mavenCentral()
32+
jcenter()
1533
}
1634

17-
description = 'This project aims to provide the facility to easily implement JSON-RPC for the java programming language.'
18-
version = '1.5.3-2'
19-
group = 'com.github.briandilley.jsonrpc4j'
35+
apply plugin: "java"
36+
apply plugin: "com.adarshr.test-logger"
37+
38+
group = "com.github.briandilley.jsonrpc4j"
39+
version = "1.6"
40+
description = """
41+
This project aims to provide the facility to easily implement JSON-RPC for the java programming language.
42+
"""
2043

2144
sourceCompatibility = 1.8
2245
targetCompatibility = 1.8
@@ -25,159 +48,97 @@ compileJava {
2548
options.encoding = 'UTF-8'
2649
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
2750
}
51+
52+
ext {
53+
releaseVersion = !version.toString().endsWith('-SNAPSHOT')
54+
}
55+
2856
test {
29-
maxParallelForks 5
57+
testLogging {
58+
exceptionFormat = "FULL"
59+
showExceptions = true
60+
showStackTraces = true
61+
showCauses = true
62+
}
63+
maxParallelForks = 1
64+
forkEvery = 1
65+
maxHeapSize = "2g"
66+
finalizedBy jacocoTestReport
3067
}
31-
compileTestJava {
32-
options.encoding = 'UTF-8'
33-
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
68+
69+
jacoco {
70+
toolVersion = "0.8.5"
3471
}
3572

36-
apply plugin: "maven"
73+
jacocoTestReport {
74+
dependsOn test
75+
reports {
76+
xml.enabled true
77+
csv.enabled true
78+
html.enabled true
79+
}
80+
}
3781

38-
repositories {
39-
mavenLocal()
40-
mavenCentral()
82+
java {
83+
registerFeature('servletSupport') {
84+
usingSourceSet(sourceSets.main)
85+
}
86+
registerFeature('springSupport') {
87+
usingSourceSet(sourceSets.main)
88+
}
4189
}
4290

4391
dependencies {
44-
ext {
45-
jacksonVersion = '2.10.2'
46-
springVersion = '4.3.26.RELEASE'
47-
springBotVersion = '1.4.7.RELEASE'
48-
jettyVersion = '9.4.0.RC3'
49-
slf4jVersion = '1.7.30'
50-
}
5192

52-
compile 'net.iharder:base64:2.3.9'
53-
compile "org.slf4j:slf4j-api:${slf4jVersion}"
54-
provided 'javax.portlet:portlet-api:2.0'
55-
provided 'javax.servlet:javax.servlet-api:3.1.0'
93+
implementation 'net.iharder:base64:2.3.9'
94+
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
95+
96+
97+
servletSupportImplementation 'javax.portlet:portlet-api:3.0.1'
98+
servletSupportImplementation 'javax.servlet:javax.servlet-api:4.0.1'
5699

57-
compile "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
58-
compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
59-
compile "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
100+
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
101+
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
102+
implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
60103

61-
compile "org.springframework:spring-core:${springVersion}", optional
62-
compile "org.springframework:spring-context:${springVersion}", optional
63-
compile "org.springframework:spring-web:${springVersion}", optional
64-
compile "org.springframework:spring-webmvc:${springVersion}", optional
104+
springSupportImplementation "org.springframework:spring-core:${springVersion}"
105+
springSupportImplementation "org.springframework:spring-context:${springVersion}"
106+
springSupportImplementation "org.springframework:spring-web:${springVersion}"
107+
springSupportImplementation "org.springframework:spring-webmvc:${springVersion}"
65108

66-
compile 'commons-codec:commons-codec:1.10', optional
67-
compile 'org.apache.httpcomponents:httpcore-nio:4.4.5', optional
109+
implementation 'commons-codec:commons-codec:1.10'
110+
implementation 'org.apache.httpcomponents:httpcore-nio:4.4.5'
68111

69-
testCompile 'junit:junit:4.12'
70-
testCompile 'org.easymock:easymock:3.4'
71-
testCompile("org.springframework.boot:spring-boot-starter-web:${springBotVersion}") {
112+
testImplementation 'junit:junit:4.12'
113+
testImplementation 'org.easymock:easymock:3.4'
114+
testImplementation("org.springframework.boot:spring-boot-starter-web:${springBotVersion}") {
72115
exclude module: 'logback-classic'
73116
}
74-
testCompile "org.springframework.boot:spring-boot-starter-test:${springBotVersion}"
75-
testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}") {
117+
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBotVersion}"
118+
testImplementation("org.eclipse.jetty:jetty-server:${jettyVersion}") {
76119
exclude module: 'javax.servlet'
77120
}
78-
testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
121+
testImplementation("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
79122
exclude module: 'org.eclipse.jetty.orbit'
80123
}
81124
testRuntime 'org.apache.logging.log4j:log4j-slf4j-impl:2.7'
82125
testRuntime 'org.apache.logging.log4j:log4j-core:2.7'
83126

84127
}
85128

86-
jar {
87-
manifest {
88-
instruction 'Import-Package',
89-
'org.aopalliance.intercept;resolution:="optional"',
90-
'org.apache.http.*;resolution:="optional"',
91-
'org.springframework.*;resolution:="optional"',
92-
'org.apache.commons.logging;resolution:="optional"',
93-
'javax.portlet;resolution:="optional"',
94-
'javax.servlet*;version=0.0.0',
95-
'*'
96-
}
97-
}
98-
99-
jacoco {
100-
toolVersion = '0.7.6.201602180812'
101-
reportsDir = file("$buildDir/customJacocoReportDir")
102-
}
103129

104-
jacocoTestReport {
105-
reports {
106-
xml.enabled false
107-
csv.enabled false
108-
html.destination "${buildDir}/jacocoHtml"
109-
}
130+
task documentationJar(type: Jar) {
131+
archiveClassifier.set("javadoc")
132+
from javadoc
110133
}
111134

112-
113-
publishing {
114-
publications {
115-
release(MavenPublication) {
116-
from components.java
117-
artifact tasks.javadocJar
118-
artifact tasks.sourceJar
119-
pom.withXml {
120-
def root = asNode()
121-
root.appendNode('name', project.name)
122-
root.appendNode('description', project.description)
123-
def pomProperties = root.appendNode('properties')
124-
pomProperties.appendNode('release_Manifest_Version', '1.0')
125-
pomProperties.appendNode('release_Implementation_Title', "${project.group}:${project.name}:${project.version}")
126-
pomProperties.appendNode('release_Implementation_Version', project.version)
127-
pomProperties.appendNode('release_Build_Date', new Date().format('yyyy-MM-dd_HH:mm:ss'))
128-
pomProperties.appendNode('release_Created_By', "${System.getProperty('java.runtime.version')} (${System.getProperty('java.vm.specification.vendor')})")
129-
pomProperties.appendNode('release_Build_Java_Version', System.getProperty('java.version'))
130-
pomProperties.appendNode('release_X_Compile_Target_JDK', project.targetCompatibility)
131-
pomProperties.appendNode('release_X_Compile_Source_JDK', project.sourceCompatibility)
132-
root.appendNode('url', 'https://github.com/briandilley/jsonrpc4j')
133-
root.appendNode('scm').appendNode('url', 'https://github.com/briandilley/jsonrpc4j.git')
134-
def devs = root.appendNode('developers')
135-
def bernat = devs.appendNode('developer')
136-
bernat.appendNode('id', 'gaborbernat')
137-
bernat.appendNode('name', 'Bernát Gábor')
138-
bernat.appendNode('email', '[email protected]')
139-
def slipper = devs.appendNode('developer')
140-
slipper.appendNode('id', 'mslipper')
141-
slipper.appendNode('name', 'Matthew Slipper')
142-
slipper.appendNode('email', '[email protected]')
143-
def apache = root.appendNode('licenses').appendNode('license')
144-
apache.appendNode('name', 'The MIT License')
145-
apache.appendNode('url', 'https://opensource.org/licenses/MIT')
146-
apache.appendNode('distribution', 'repo')
147-
}
148-
}
149-
}
135+
task sourcesJar(type: Jar) {
136+
archiveClassifier.set("sources")
137+
from sourceSets.main.allSource
150138
}
151139

152-
bintray {
153-
user = project.hasProperty('user') ? project.property('user') : 'not_set'
154-
key = project.hasProperty('key') ? project.property('key') : 'not_set'
155-
dryRun = false
156-
publish = true
157-
pkg {
158-
repo = 'maven'
159-
name = 'com.github.briandilley.jsonrpc4j:jsonrpc4j'
160-
desc = project.description
161-
licenses = ['MIT']
162-
publications = ['release']
163-
websiteUrl = 'https://briandilley.github.io/jsonrpc4j'
164-
issueTrackerUrl = 'https://github.com/briandilley/jsonrpc4j/issues'
165-
vcsUrl = '[email protected]:briandilley/jsonrpc4j.git'
166-
githubRepo = 'briandilley/jsonrpc'
167-
githubReleaseNotesFile = 'README.md'
168-
labels = ['json', 'rpc', 'java']
169-
publicDownloadNumbers = true
170-
version {
171-
gpg {
172-
sign = true
173-
}
174-
name = project.version
175-
vcsTag = project.version
176-
released = new Date()
177-
}
178-
}
140+
artifacts {
141+
archives documentationJar, sourcesJar
179142
}
180143

181-
bintrayUpload {
182-
dependsOn "publishToMavenLocal"
183-
}
144+
apply from: 'publishing.gradle'

gradle/wrapper/gradle-wrapper.jar

1.92 KB
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Feb 17 20:25:46 GMT+03:00 2017
1+
#Mon Oct 07 19:30:35 PDT 2019
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
23
distributionBase=GRADLE_USER_HOME
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

pom.gradle

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
allprojects { project ->
2+
publishing {
3+
publications {
4+
jsonrpc4j {
5+
pom {
6+
name = rootProject.name.capitalize() + (project.parent ? " ($shortName)" : '')
7+
description = project.description
8+
url = 'https://github.com/briandilley/jsonrpc4j'
9+
issueManagement {
10+
system = 'GitHub'
11+
url = 'https://github.com/briandilley/jsonrpc4j/issues'
12+
}
13+
ciManagement {
14+
system = 'Github Actions'
15+
url = 'https://github.com/briandilley/jsonrpc4j/actions'
16+
}
17+
inceptionYear = '2013'
18+
developers {
19+
developer {
20+
id = 'briandilley'
21+
name = 'Brian Dilley'
22+
23+
url = 'https://github.com/briandilley'
24+
timezone = 'America/Los_Angeles'
25+
}
26+
}
27+
licenses {
28+
license {
29+
name = 'The MIT License (MIT)'
30+
url = 'https://github.com/briandilley/jsonrpc4j/blob/develop/LICENSE'
31+
distribution = 'repo'
32+
comments = 'A business-friendly OSS license'
33+
}
34+
}
35+
scm {
36+
connection = 'scm:git:https://github.com/briandilley/jsonrpc4j.git'
37+
developerConnection = '[email protected]:briandilley/jsonrpc4j.git'
38+
url = 'https://github.com/briandilley/jsonrpc4j'
39+
}
40+
distributionManagement {
41+
downloadUrl = 'https://github.com/briandilley/jsonrpc4j/releases'
42+
}
43+
}
44+
}
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)