# HG changeset patch # User Mike Becker # Date 1672402869 -3600 # Node ID c357c4e69b9ec575f7e66dbc7cc8d7c2ef7cbf6d # Parent 1467d182cfe388c176e2f2a94bce00d248ff406b make JSTL and postgres (optionally) runtime dependencies again diff -r 1467d182cfe3 -r c357c4e69b9e INSTALL --- a/INSTALL Thu Dec 29 15:12:25 2022 +0100 +++ b/INSTALL Fri Dec 30 13:21:09 2022 +0100 @@ -26,10 +26,16 @@ the lightpit_app user which has less privileges to create the data source and leave the lightpit_dbo user for the database operator. -4. Deploy the WAR file of lightpit +4. Build and Deploy the WAR file of lightpit -This is the most straight forward step. Just deploy the WAR file as you usually -do in your application server. +Build the WAR file with gradle. If your application server already provides +the necessary runtime libraries for JSTL and PostgreSQL, leave the variable +libsAreProvided = true during the build. Otherwise, set this variable to false +and the libraries will be included in the WAR file. But keep in mind that some +servlet containers, like Tomcat, are not so happy about this when hot redeploy- +ments are performed. If you experience ClassDefNotFound errors after a hot +redeployment, you should either provide the libs in your container or always +restart the entire container after a redeployment. 5. Configuring a web server and authentication diff -r 1467d182cfe3 -r c357c4e69b9e build.gradle.kts --- 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}")