1- apply plugin : ' com.jfrog.bintray '
1+ // Apply necessary plugins
22apply plugin : ' java'
3- apply plugin : ' idea'
4- apply plugin : ' maven'
3+ apply plugin : ' maven-publish'
54
6- version = " 1.0.49"
5+ // Define the version and group for the Maven package
6+ version = " 1.0.50"
7+ group = " net.servicestack"
78
9+ // Specify dependencies
810dependencies {
9- implementation group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.6 '
10- testImplementation ' junit:junit:4.12 '
11+ implementation ' com.google.code.gson: gson: 2.8.9 '
12+ testImplementation ' junit:junit:4.13.1 '
1113 testImplementation ' pl.pragmatists:JUnitParams:1.1.1'
1214}
1315
14- group = " net.servicestack" // Maven Group ID for the artifact
15- String packageId = " client"
16- String groupID = group
17- String versionNum = version
18-
19- String siteUrl = ' https://github.com/ServiceStack/ServiceStack.Java' // Homepage URL of the library
20- String gitUrl = ' https://github.com/ServiceStack/ServiceStack.Java.git' // Git repository URL
16+ // Additional tasks for generating source and Javadoc JARs
17+ task sourcesJar (type : Jar ) {
18+ from sourceSets. main. allJava
19+ archiveClassifier. set(' sources' )
20+ }
2121
22- Properties properties = System . properties;
23- if (properties . getProperty( " bintray.user " , null ) == null ) {
24- properties . load(project . file( ' ./local.properties ' ) . newDataInputStream() )
22+ task javadocJar ( type : Jar , dependsOn : javadoc) {
23+ from javadoc . destinationDir
24+ archiveClassifier . set( ' javadoc ' )
2525}
2626
27- install {
28- repositories. mavenInstaller {
29- pom {
30- project {
31- packaging ' jar'
32- groupId groupID
33- artifactId packageId
34- version versionNum
35- // Add your description here
36- name ' ServiceStack.Client'
37- description ' A client library to call your ServiceStack webservices.'
38- url siteUrl
27+ // Configure the publishing block for Maven Central deployment
28+ publishing {
29+ publications {
30+ mavenJava(MavenPublication ) {
31+ from components. java
3932
40- // Set your license
33+ // Attach source and javadoc JARs
34+ artifact sourcesJar
35+ artifact javadocJar
36+
37+ pom {
38+ name = ' ServiceStack.Client'
39+ description = ' A client library to call your ServiceStack webservices.'
40+ url = ' https://github.com/ServiceStack/ServiceStack.Java'
41+
42+ version = version
4143 licenses {
4244 license {
43- name ' The BSD 3-Clause License'
44- url ' https://servicestack.net/bsd-license.txt'
45+ name = ' The BSD 3-Clause License'
46+ url = ' https://servicestack.net/bsd-license.txt'
4547 }
4648 }
4749
4850 developers {
4951 developer {
50- id ' mythz'
51- name ' Demis Bellot'
52- email ' team@servicestack.net'
52+ id = ' mythz'
53+ name = ' Demis Bellot'
54+ email = ' team@servicestack.net'
5355 }
5456 developer {
55- id ' layoric'
56- name ' Darren Reid'
57- email ' team@servicestack.net'
57+ id = ' layoric'
58+ name = ' Darren Reid'
59+ email = ' team@servicestack.net'
5860 }
5961 }
62+
6063 scm {
61- connection ' https://github.com/ServiceStack/ServiceStack.Java'
62- developerConnection ' https://github.com/ServiceStack/ServiceStack.Java'
63- url ' https://github.com/ServiceStack/ServiceStack.Java'
64+ connection = ' https://github.com/ServiceStack/ServiceStack.Java.git '
65+ developerConnection = ' https://github.com/ServiceStack/ServiceStack.Java.git '
66+ url = ' https://github.com/ServiceStack/ServiceStack.Java'
6467 }
6568 }
66- }. writeTo( ' pom.xml ' )
69+ }
6770 }
68- }
6971
70- bintray {
71- user = properties. getProperty(" bintray.user" )
72- key = properties. getProperty(" bintray.apiKey" )
73-
74- configurations = [' archives' ]
75- pkg {
76- repo = " maven"
77- userOrg = ' servicestack'
78- name = " ServiceStack.Client"
79- websiteUrl = siteUrl
80- vcsUrl = gitUrl
81- licenses = [" BSD 3-Clause" ]
82- publish = properties. getProperty(' bintray.publish' ) == ' true'
72+ repositories {
73+ maven {
74+ name = ' OSSRH'
75+ url = uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
76+ credentials {
77+ username = project. findProperty(" ossrhUsername" ) ?: System . getenv(" OSSRH_USERNAME" )
78+ password = project. findProperty(" ossrhPassword" ) ?: System . getenv(" OSSRH_TOKEN" )
79+ }
80+ }
81+ maven {
82+ url = uri(" file://${ project.rootDir} /localRepo" )
83+ }
8384 }
8485}
8586
86- task sourcesJar (type : Jar , dependsOn : classes) {
87- classifier = ' sources'
88- from sourceSets. main. allSource
89- }
90-
91- task javadocJar (type : Jar , dependsOn : javadoc) {
92- classifier = ' javadoc'
93- from javadoc. destinationDir
94- }
95-
96- artifacts {
97- archives sourcesJar
98- archives javadocJar
87+ java {
88+ sourceCompatibility = JavaVersion . VERSION_1_8
89+ targetCompatibility = JavaVersion . VERSION_1_8
9990}
0 commit comments