build.gradle.kts

changeset 262
c357c4e69b9e
parent 258
564ae07a6def
child 272
edb6f12b334b
--- a/build.gradle.kts	Thu Dec 29 15:12:25 2022 +0100
+++ b/build.gradle.kts	Fri Dec 30 13:21:09 2022 +0100
@@ -25,14 +25,18 @@
     from("src/main/resources")
 }
 
+val libsAreProvided = true
 kotlin {
     sourceSets {
         val main by getting {
             dependencies {
-                // change the following to compileOnly, if you already have them on your server
-                implementation("jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0")
-                implementation("org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1")
-                implementation("org.postgresql:postgresql:42.5.1")
+                arrayOf(
+                    "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0",
+                    "org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1",
+                    "org.postgresql:postgresql:42.5.1"
+                ).forEach {
+                    if (libsAreProvided) compileOnly(it) else implementation(it)
+                }
                 compileOnly("jakarta.servlet:jakarta.servlet-api:6.0.0")
                 val flexmarkVersion = "0.64.0"
                 implementation("com.vladsch.flexmark:flexmark:${flexmarkVersion}")

mercurial