From 6a5bfc01f9ab051f3b61afe277ef51475e2cf643 Mon Sep 17 00:00:00 2001 From: Shabaz Basha Kowthalam Date: Wed, 13 Nov 2024 17:26:45 +0530 Subject: [PATCH] Added log4j dependency and Java compatibility version --- build.gradle | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 4125204..1ac79a9 100644 --- a/build.gradle +++ b/build.gradle @@ -4,11 +4,32 @@ plugins { id 'java' } +repositories { + mavenCentral() +} + defaultTasks("dist") +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +dependencies { + // Add Log4j core and API as dependencies (update version as needed) + implementation 'org.apache.logging.log4j:log4j-core:2.24.1' + implementation 'org.apache.logging.log4j:log4j-api:2.24.1' +} + +// Task to copy dependencies to the lib directory +tasks.register('copyDependencies', Copy) { + from configurations.runtimeClasspath + into "build/libs" +} + tasks.register("dist", Zip) { - dependsOn("build") + dependsOn("copyDependencies", "build") from("build/libs") { include("*.jar")