diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f596298..384b1a44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Change Log +## [5.45.6](https://github.com/plivo/plivo-java/tree/v5.45.6) (2025-03-03) +**Fix - Upgraded version for okhttp3 package.** +- Upgraded version of the okhttp3 package . + ## [5.45.5](https://github.com/plivo/plivo-java/tree/v5.45.5) (2025-02-25) **Enhancement - Supporting parameter_name in WhatsApp Template .** - Supporting parameter_name in WhatsApp Template . diff --git a/README.md b/README.md index 1461c707..1fdef7da 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The Plivo Java SDK makes it simpler to integrate communications into your Java a ### To Install Stable release -You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.45.5/plivo-java-5.45.5.jar). +You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.45.6/plivo-java-5.45.6.jar). If you are using Maven, use the following XML to include the Plivo SDK as a dependency. @@ -19,13 +19,13 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe com.plivo plivo-java - 5.45.5 + 5.45.6 ``` If you are using Gradle, use the following line in your dependencies. ``` -compile 'com.plivo:plivo-java:5.45.5' +compile 'com.plivo:plivo-java:5.45.6' ``` ### To Install Beta release diff --git a/build.gradle b/build.gradle index 1826ddb4..d92de7fc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,199 +1,212 @@ -group 'com.plivo' -version new File("${projectDir}/src/main/resources/com/plivo/api/version.txt").readLines().get(0) -ext["mavenUserName"] = System.getenv("MAVEN_USERNAME") ?: "" -ext["mavenPassword"] = System.getenv("MAVEN_PASSWORD") ?: "" - - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0' - } - +plugins { + id 'java-library' + id 'maven-publish' + id 'signing' + id 'checkstyle' + id 'idea' + id 'eclipse' + id 'application' + id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'io.codearte.nexus-staging' version '0.30.0' } -buildscript { - repositories { - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.12.0" - } -} -apply plugin: 'com.github.johnrengelman.shadow' -apply plugin: 'java' -apply plugin: 'checkstyle' -apply plugin: 'idea' -apply plugin: 'eclipse' -apply plugin: 'maven' -apply plugin: 'maven-publish' -apply plugin: 'signing' -apply plugin: 'io.codearte.nexus-staging' +group = 'com.plivo' +version = new File("${projectDir}/src/main/resources/com/plivo/api/version.txt").readLines().get(0) -nexusStaging { - numberOfRetries = 60 - delayBetweenRetriesInMillis = 40000 +repositories { + mavenCentral() + gradlePluginPortal() } -repositories { - mavenCentral() +java { + withJavadocJar() + withSourcesJar() + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:unchecked" - options.fork = true; options.forkOptions.executable = 'javac' - options.compilerArgs << "-XDignore.symbol.file=true" + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + options.compilerArgs << "-Xlint:unchecked" + options.compilerArgs << "-XDignore.symbol.file=true" } dependencies { - testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile group: 'com.squareup.okhttp', name: 'mockwebserver', version: '2.7.5' - - compile 'com.squareup.retrofit2:converter-jackson:2.2.0' - compile 'com.squareup.retrofit2:retrofit:2.2.0' - compile 'com.squareup.okhttp3:logging-interceptor:3.7.0' - compile 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.2' - compile 'org.glassfish.jaxb:jaxb-runtime:2.3.2' - compile 'com.auth0:java-jwt:3.10.2' + testImplementation(platform('org.junit:junit-bom:5.10.0')) + testImplementation('org.junit.jupiter:junit-jupiter') + testRuntimeOnly('org.junit.platform:junit-platform-launcher') + + testImplementation 'com.squareup.okhttp:mockwebserver:2.7.5' + + implementation 'com.squareup.retrofit2:converter-jackson:2.2.0' + implementation 'com.squareup.retrofit2:retrofit:2.2.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + implementation 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.2' + implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.2' + implementation 'com.auth0:java-jwt:3.10.2' +} + +checkstyle { + toolVersion = '8.45.1' + configFile = file("${projectDir}/config/checkstyle/checkstyle.xml") + configProperties = [ + 'checkstyle.cache.file': "${buildDir}/checkstyle.cache" + ] + showViolations = true + sourceSets = [sourceSets.main, sourceSets.test] + ignoreFailures = false +} + +test { + useJUnitPlatform() + testLogging { + events "passed", "skipped", "failed" + } + ignoreFailures = false } javadoc { - title "Plivo Java SDK" - options.linkSource = true + title = "Plivo Java SDK" + options.linkSource = true } jar { - manifest { - attributes( - "Created-By": 'Plivo', - 'Implementation-Vendor': 'Plivo', - 'Implementation-Title': 'Plivo Java SDK', - 'Implementation-Version': version - ) - } + manifest { + attributes( + "Created-By": 'Plivo', + 'Implementation-Vendor': 'Plivo', + 'Implementation-Title': 'Plivo Java SDK', + 'Implementation-Version': version + ) + } } -task sourceJar(type: Jar, dependsOn: classes) { - classifier 'sources' - from sourceSets.main.allSource +shadowJar { + archiveClassifier.set('all') + archiveBaseName.set("plivo-java-${version}-jar-with-dependencies") } -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir +// Add fatJar task that depends on shadowJar +task fatJar { + dependsOn shadowJar } -task fatJar(type: Jar) { - manifest { - attributes 'Implementation-Title': 'Plivo fat jar', - 'Implementation-Version': version - } - archiveName = "plivo-java-${version}-jar-with-dependencies.jar" - from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } - with jar - print("Created fatjar: ${destinationDir}/${archiveName}") +nexusStaging { + numberOfRetries = 60 + delayBetweenRetriesInMillis = 40000 } task createPom { - doLast - { - pom { - project { - name 'plivo-java' - packaging 'jar' - description 'A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML' - - licenses { - license { - name 'The MIT License' - url 'https://github.com/plivo/plivo-java/blob/4.0/LICENSE.txt' - distribution 'repo' - } - } - - developers { - developer { - name 'The Plivo SDKs Team' - email 'sdks@plivo.com' - organization 'Plivo, Inc.' - organizationUrl 'https://plivo.com' - } - } - - scm { - url 'git@github.com:plivo/plivo-java.git' - connection 'scm:git:git@github.com:plivo/plivo-java.git' - developerConnection 'scm:git:git@github.com:plivo/plivo-java.git' - } + doLast { + def pomFile = file("$buildDir/pom.xml") + pomFile.parentFile.mkdirs() + pomFile.createNewFile() + pomFile.text = """ + + + 4.0.0 + ${project.group} + plivo-java + ${project.version} + jar + plivo-java + A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML + https://github.com/plivo/plivo-java/ + + + + The MIT License + https://github.com/plivo/plivo-java/blob/4.0/LICENSE.txt + repo + + + + + + The Plivo SDKs Team + sdks@plivo.com + Plivo, Inc. + https://plivo.com + + + + + git@github.com:plivo/plivo-java.git + scm:git:git@github.com:plivo/plivo-java.git + scm:git:git@github.com:plivo/plivo-java.git + + +""" } - }.writeTo("pom.xml") -} } -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { - MavenDeployment deployment -> signing.signPom(deployment) - } - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication( - userName: mavenUserName, - password: mavenPassword - ) - } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication( - userName: mavenUserName, - password: mavenPassword - ) - } - pom.project { - name 'plivo-java' - packaging 'jar' - artifactId 'plivo-java' - description 'A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML' - url 'https://github.com/plivo/plivo-java/' - scm { - connection 'scm:git:git@github.com:plivo/plivo-java.git' - developerConnection 'scm:git:git@github.com:plivo/plivo-java.git' - url 'git@github.com:plivo/plivo-java.git' - } - licenses { - license { - name 'The MIT License' - url 'https://github.com/plivo/plivo-java/blob/4.0/LICENSE.txt' - } +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + + pom { + name = 'plivo-java' + packaging = 'jar' + artifactId = 'plivo-java' + description = 'A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML' + url = 'https://github.com/plivo/plivo-java/' + + scm { + connection = 'scm:git:git@github.com:plivo/plivo-java.git' + developerConnection = 'scm:git:git@github.com:plivo/plivo-java.git' + url = 'git@github.com:plivo/plivo-java.git' + } + + licenses { + license { + name = 'The MIT License' + url = 'https://github.com/plivo/plivo-java/blob/4.0/LICENSE.txt' + } + } + + organization { + name = 'Plivo' + url = 'https://api-reference.plivo.com/latest/net/introduction/overview' + } + + issueManagement { + system = 'GitHub' + url = 'https://github.com/plivo/plivo-java/issues' + } + + developers { + developer { + name = 'The Plivo SDKs Team' + email = 'sdks@plivo.com' + organization = 'Plivo, Inc.' + organizationUrl = 'https://plivo.com' + } + } + } } - organization { - name 'Plivo' - url 'https://api-reference.plivo.com/latest/net/introduction/overview' - } - issueManagement { - system 'GitHub' - url 'https://github.com/plivo/plivo-java/issues' - } - developers { - developer { - name 'The Plivo SDKs Team' - email 'sdks@plivo.com' - } + } + + repositories { + maven { + def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + + credentials { + username = System.getenv("MAVEN_USERNAME") ?: project.findProperty('mavenUserName') ?: '' + password = System.getenv("MAVEN_PASSWORD") ?: project.findProperty('mavenPassword') ?: '' + } } - } } - } } - -artifacts { - archives javadocJar, sourceJar +signing { + required { !version.endsWith('SNAPSHOT') && gradle.taskGraph.hasTask("publish") } + sign publishing.publications.mavenJava } -signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - sign configurations.archives +application { + mainClass = 'com.plivo.examples.Messages' } diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 66166b08..99a8c26a 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -14,179 +14,175 @@ --> - + + + - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 23d347a8..ee459fe8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip \ No newline at end of file diff --git a/pom.properties b/pom.properties index ccc36ab0..feaca3f1 100644 --- a/pom.properties +++ b/pom.properties @@ -1,6 +1,6 @@ # Written manually. -version=5.45.5 +version=5.45.6 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index 8155c597..b934ee21 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ com.squareup.okhttp3 logging-interceptor - 3.7.0 + 4.12.0 compile diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index 0315a169..3c482d53 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.45.5 +5.45.6