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+
124plugins {
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
2144sourceCompatibility = 1.8
2245targetCompatibility = 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+
2856test {
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
4391dependencies {
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'
0 commit comments