Skip to content

Commit

Permalink
Merge pull request #1222 from HindujaB/java21
Browse files Browse the repository at this point in the history
Migrate to Java 21
  • Loading branch information
warunalakshitha authored Nov 19, 2024
2 parents a28b80b + 7411027 commit 29dfcb0
Show file tree
Hide file tree
Showing 24 changed files with 213 additions and 180 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-with-ballerina-lang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
repository: 'ballerina-platform/ballerina-lang'
ref: ${{ inputs.lang_tag || 'master' }}

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
java-version: 21.0.3

- name: Set Ballerina Lang version
run: |
Expand Down Expand Up @@ -77,11 +77,11 @@ jobs:
repository: 'ballerina-platform/ballerina-lang'
ref: ${{ inputs.lang_tag || 'master' }}

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
java-version: 21.0.3

- name: Set Ballerina Lang version
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
java-version: 21.0.3

- name: Set environment variable
if: github.event.action == 'check_connector_for_breaking_changes'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ This repository only contains the source code for the library.

### Set up the prerequisites

* Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).
* Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations).

* [Oracle](https://www.oracle.com/java/technologies/downloads/)

Expand Down
22 changes: 11 additions & 11 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
[package]
org = "ballerinax"
name = "kafka"
version = "4.2.0"
version = "4.3.0"
authors = ["Ballerina"]
keywords = ["kafka", "event streaming", "network", "messaging"]
repository = "https://github.com/ballerina-platform/module-ballerinax-kafka"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"
distribution = "2201.10.0-20241025-103700-5c9e6a27"

[platform.java17]
[platform.java21]
graalvmCompatible = true

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "kafka-native"
version = "4.2.0"
path = "../native/build/libs/kafka-native-4.2.0.jar"
version = "4.3.0"
path = "../native/build/libs/kafka-native-4.3.0-SNAPSHOT.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "org.apache.kafka"
artifactId = "kafka-clients"
version = "3.5.1"
path = "./lib/kafka-clients-3.5.1.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "org.apache.kafka"
artifactId = "kafka_2.12"
version = "3.5.1"
path = "./lib/kafka_2.12-3.5.1.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "constraint-native"
version = "1.5.0"
path = "./lib/constraint-native-1.5.0.jar"
version = "1.6.0"
path = "./lib/constraint-native-1.6.0-20241113-090900-d276ad5.jar"

[build-options]
observabilityIncluded=true
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "kafka-compiler-plugin"
class = "io.ballerina.stdlib.kafka.plugin.KafkaCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/kafka-compiler-plugin-4.2.0.jar"
path = "../compiler-plugin/build/libs/kafka-compiler-plugin-4.3.0-SNAPSHOT.jar"
49 changes: 30 additions & 19 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.10.0"
distribution-version = "2201.11.0-20241112-214900-6b80ab87"

[[package]]
org = "ballerina"
name = "auth"
version = "2.12.0"
version = "2.12.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "crypto"},
Expand All @@ -23,7 +23,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "cache"
version = "3.8.0"
version = "3.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "constraint"},
Expand All @@ -35,7 +35,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "constraint"
version = "1.5.0"
version = "1.6.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -47,7 +47,7 @@ modules = [
[[package]]
org = "ballerina"
name = "crypto"
version = "2.7.2"
version = "2.7.3"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -56,10 +56,20 @@ modules = [
{org = "ballerina", packageName = "crypto", moduleName = "crypto"}
]

[[package]]
org = "ballerina"
name = "data.jsondata"
version = "0.3.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.object"}
]

[[package]]
org = "ballerina"
name = "file"
version = "1.10.0"
version = "1.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -71,13 +81,14 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.12.0"
version = "2.13.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "data.jsondata"},
{org = "ballerina", name = "file"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -100,7 +111,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.6.2"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -121,7 +132,7 @@ modules = [
[[package]]
org = "ballerina"
name = "jwt"
version = "2.13.0"
version = "2.13.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -244,7 +255,7 @@ modules = [
[[package]]
org = "ballerina"
name = "log"
version = "2.10.0"
version = "2.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -259,7 +270,7 @@ modules = [
[[package]]
org = "ballerina"
name = "mime"
version = "2.10.0"
version = "2.10.2"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -271,7 +282,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "oauth2"
version = "2.12.0"
version = "2.12.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "cache"},
Expand All @@ -285,15 +296,15 @@ dependencies = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.3.0"
version = "1.4.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "os"
version = "1.8.0"
version = "1.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -303,7 +314,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "task"
version = "2.5.0"
version = "2.5.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -327,15 +338,15 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.6.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "url"
version = "2.4.0"
version = "2.4.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -344,7 +355,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "uuid"
version = "1.8.0"
version = "1.8.1"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -392,7 +403,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "kafka"
version = "4.2.0"
version = "4.3.0"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "crypto"},
Expand Down
4 changes: 2 additions & 2 deletions ballerina/tests/listener_client_tests.bal
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function listenerConfigErrorTest() returns error? {
}

@test:Config {
enable: true,
enable: false,
dependsOn: [consumerServiceCommitTest]
}
function consumerServiceCommitOffsetTest() returns error? {
Expand Down Expand Up @@ -309,7 +309,7 @@ function consumerServiceCommitOffsetTest() returns error? {
check serviceConsumer.gracefulStop();
}

@test:Config {enable: true}
@test:Config {enable: false}
function consumerServiceCommitTest() returns error? {
string topic = "listener-commit-test-topic";
kafkaTopics.push(topic);
Expand Down
4 changes: 2 additions & 2 deletions ballerina/tests/producer_client_tests.bal
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function producerGetTopicPartitionsErrorTest() returns error? {
check producer->close();
}

@test:Config {enable: true}
@test:Config {enable: false}
function transactionalProducerTest() returns error? {
string topic = "transactional-producer-test-topic";
kafkaTopics.push(topic);
Expand Down Expand Up @@ -217,7 +217,7 @@ function transactionalProducerTest() returns error? {
check consumer->close();
}

@test:Config {enable: true}
@test:Config {enable: false}
function transactionalProducerWithAbortTest() returns error? {
string topic = "rollback-producer-test-topic";
kafkaTopics.push(topic);
Expand Down
12 changes: 6 additions & 6 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ keywords = ["kafka", "event streaming", "network", "messaging"]
repository = "https://github.com/ballerina-platform/module-ballerinax-kafka"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.11.0"
distribution = "2201.10.0-20241025-103700-5c9e6a27"

[platform.java17]
[platform.java21]
graalvmCompatible = true

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "kafka-native"
version = "@toml.version@"
path = "../native/build/libs/[email protected]@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "org.apache.kafka"
artifactId = "kafka-clients"
version = "@kafka.version@"
path = "./lib/[email protected]@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "org.apache.kafka"
artifactId = "kafka_2.12"
version = "@kafka.version@"
path = "./lib/[email protected]@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "constraint-native"
version = "@constraint.version@"
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
*/

plugins {
id "com.github.spotbugs" version "5.0.14"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "de.undercouch.download" version "5.4.0"
id "net.researchgate.release" version "2.8.0"
id "com.github.spotbugs" version "${spotbugsPluginVersion}"
id "com.github.johnrengelman.shadow" version "${shadowJarPluginVersion}"
id "de.undercouch.download" version "${downloadPluginVersion}"
id "net.researchgate.release" version "${releasePluginVersion}"
}

allprojects {
Expand Down
7 changes: 5 additions & 2 deletions compiler-plugin-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ checkstyle {
checkstyleTest.dependsOn(":checkstyle:downloadCheckstyleRuleFiles")

spotbugsTest {
effort "max"
reportLevel "low"
def classLoader = plugins["com.github.spotbugs"].class.classLoader
def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence")
def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort")
effort = SpotBugsEffort.MAX
reportLevel = SpotBugsConfidence.LOW
reportsDir = file("$project.buildDir/reports/spotbugs")
reports {
html.enabled true
Expand Down
Loading

0 comments on commit 29dfcb0

Please sign in to comment.