Not able to create JAR

When I try to create jar file for my project with gradle using

jar {
duplicatesStrategy = DuplicatesStrategy.WARN // or DuplicatesStrategy.EXCLUDE, depending on your preference

from {
    configurations.runtimeClasspath.collect {
        it.isDirectory() ? it : zipTree(it)
    }
}

}

it gives
Encountered duplicate path “META-INF/services/io.grpc.LoadBalancerProvider” during copy operation configured with DuplicatesStrategy.WARN
Encountered duplicate path “META-INF/services/io.grpc.NameResolverProvider” during copy operation configured with DuplicatesStrategy.WARN

how can i resolve it

my build.gradle file is

plugins {
id ‘java’
id ‘application’
id “com.google.protobuf” version “0.9.4”
}

group = ‘com.example’
version = ‘1.0-SNAPSHOT’

repositories {
mavenCentral()
}

protobuf {
protoc {
artifact = ‘com.google.protobuf:protoc:3.25.2’
}

plugins {
    grpc {
        artifact = ('io.grpc:protoc-gen-grpc-java:1.54.1')
    }
}
generateProtoTasks {
    all()*.plugins {
        grpc {}
    }
}

}

sourceSets {
src {
main {
java {
srcDirs ‘build/generated/source/proto/main/grpc’
srcDirs ‘build/generated/source/proto/main/java’
}
}
}
}

//configurations {
// all* group: ‘io.grpc’, module: ‘grpc-core’
//}

dependencies {
implementation(‘io.temporal:temporal-sdk:1.22.3’)
implementation group: ‘org.slf4j’, name: ‘slf4j-nop’, version: ‘2.0.6’

runtimeOnly ('io.grpc:grpc-netty-shaded:1.54.1')
implementation ('io.grpc:grpc-protobuf:1.54.1')
implementation ('io.grpc:grpc-stub:1.54.1')

testImplementation group: 'io.temporal', name: 'temporal-testing', version: '1.22.3'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.1.1'

//runtimeOnly "mysql:mysql-connector-java:8.0.23"

compileOnly group: "javax.annotation", name: "javax.annotation-api", version: "1.3.2"
compileOnly group: "org.jetbrains", name: "annotations", version: "13.0"

}

// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

application {
// Define the main class for the application.
mainClassName = project.findProperty(“main”).toString()
}

jar {
duplicatesStrategy = DuplicatesStrategy.WARN // or DuplicatesStrategy.EXCLUDE, depending on your preference

from {
    configurations.runtimeClasspath.collect {
        it.isDirectory() ? it : zipTree(it)
    }
}

}