Wed, 28 Dec 2022 13:21:30 +0100
#233 migrate to Jakarta EE and update dependencies
1.1 --- a/INSTALL Tue Nov 01 21:31:15 2022 +0100 1.2 +++ b/INSTALL Wed Dec 28 13:21:30 2022 +0100 1.3 @@ -19,29 +19,19 @@ 1.4 3. Configure a data source in your application servlet or servlet container 1.5 1.6 You may use absolutely anything: Tomcat, TomEE, Glassfish, Payara, you name it. 1.7 +If it supports Servlet 6.0, JSP 3.1, and EL 5.0, you are good to go. 1.8 Just make sure to configure a data source with the name jdbc/lightpit/app. 1.9 If you want another name, you can configure the JNDI resource in the 1.10 WEB-INF/web.xml and META-INF/context.xml files. It is highly recommended to use 1.11 the lightpit_app user which has less privileges to create the data source and 1.12 leave the lightpit_dbo user for the database operator. 1.13 1.14 -4. Make sure JDBC driver and JSTL libraries are available 1.15 - 1.16 -This step may be optional depending on the container you are using. Most 1.17 -application servers already have JSTL libraries installed. More basic servlet 1.18 -containers like Tomcat don't. In that case you have to put the libraries of the 1.19 -javax.servlet:jstl:1.2 artifact manually into the library dir of your servlet 1.20 -container (jstl-1.2.jar and jstl-impl-1.2.jar). 1.21 - 1.22 -In most cases you also have to put the postgresql JDBC driver into the library 1.23 -directory of your server (e.g. postgres-42.x.x.jar). 1.24 - 1.25 -5. Deploy the WAR file of lightpit 1.26 +4. Deploy the WAR file of lightpit 1.27 1.28 This is the most straight forward step. Just deploy the WAR file as you usually 1.29 do in your application server. 1.30 1.31 -6. Configuring a web server and authentication 1.32 +5. Configuring a web server and authentication 1.33 1.34 LightPIT can optionally detect the authenticated user. You may freely decide 1.35 whether to enable authentication in your application server or put a web server
2.1 --- a/build.gradle.kts Tue Nov 01 21:31:15 2022 +0100 2.2 +++ b/build.gradle.kts Wed Dec 28 13:21:30 2022 +0100 2.3 @@ -1,13 +1,11 @@ 2.4 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile 2.5 2.6 plugins { 2.7 - kotlin("jvm") version "1.5.32" 2.8 + kotlin("jvm") version "1.7.21" 2.9 war 2.10 } 2.11 group = "de.uapcore" 2.12 -version = "0.6-SNAPSHOT" 2.13 - 2.14 -val flexmarkVersion = "0.62.2" 2.15 +version = "1.0-SNAPSHOT" 2.16 2.17 repositories { 2.18 mavenCentral() 2.19 @@ -32,13 +30,17 @@ 2.20 sourceSets { 2.21 val main by getting { 2.22 dependencies { 2.23 - compileOnly("javax.servlet:javax.servlet-api:3.1.0") 2.24 - compileOnly("javax.servlet:jstl:1.2") 2.25 + // change the following to compileOnly, if you already have them on your server 2.26 + implementation("jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0") 2.27 + implementation("org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1") 2.28 + implementation("org.postgresql:postgresql:42.5.1") 2.29 + compileOnly("jakarta.servlet:jakarta.servlet-api:6.0.0") 2.30 + val flexmarkVersion = "0.64.0" 2.31 implementation("com.vladsch.flexmark:flexmark:${flexmarkVersion}") 2.32 implementation("com.vladsch.flexmark:flexmark-util-data:${flexmarkVersion}") 2.33 implementation("com.vladsch.flexmark:flexmark-ext-tables:${flexmarkVersion}") 2.34 implementation("com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:${flexmarkVersion}") 2.35 - implementation("io.github.java-diff-utils:java-diff-utils:4.5") 2.36 + implementation("io.github.java-diff-utils:java-diff-utils:4.12") 2.37 } 2.38 } 2.39 }
3.1 --- a/src/main/kotlin/de/uapcore/lightpit/AbstractServlet.kt Tue Nov 01 21:31:15 2022 +0100 3.2 +++ b/src/main/kotlin/de/uapcore/lightpit/AbstractServlet.kt Wed Dec 28 13:21:30 2022 +0100 3.3 @@ -28,11 +28,11 @@ 3.4 import de.uapcore.lightpit.DataSourceProvider.Companion.SC_ATTR_NAME 3.5 import de.uapcore.lightpit.dao.DataAccessObject 3.6 import de.uapcore.lightpit.dao.createDataAccessObject 3.7 +import jakarta.servlet.http.HttpServlet 3.8 +import jakarta.servlet.http.HttpServletRequest 3.9 +import jakarta.servlet.http.HttpServletResponse 3.10 import java.sql.SQLException 3.11 import java.util.* 3.12 -import javax.servlet.http.HttpServlet 3.13 -import javax.servlet.http.HttpServletRequest 3.14 -import javax.servlet.http.HttpServletResponse 3.15 3.16 abstract class AbstractServlet : HttpServlet() { 3.17
4.1 --- a/src/main/kotlin/de/uapcore/lightpit/DataSourceProvider.kt Tue Nov 01 21:31:15 2022 +0100 4.2 +++ b/src/main/kotlin/de/uapcore/lightpit/DataSourceProvider.kt Wed Dec 28 13:21:30 2022 +0100 4.3 @@ -25,13 +25,13 @@ 4.4 4.5 package de.uapcore.lightpit 4.6 4.7 +import jakarta.servlet.ServletContextEvent 4.8 +import jakarta.servlet.ServletContextListener 4.9 +import jakarta.servlet.annotation.WebListener 4.10 import java.sql.SQLException 4.11 import javax.naming.Context 4.12 import javax.naming.InitialContext 4.13 import javax.naming.NamingException 4.14 -import javax.servlet.ServletContextEvent 4.15 -import javax.servlet.ServletContextListener 4.16 -import javax.servlet.annotation.WebListener 4.17 import javax.sql.DataSource 4.18 4.19 /**
5.1 --- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt Tue Nov 01 21:31:15 2022 +0100 5.2 +++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt Wed Dec 28 13:21:30 2022 +0100 5.3 @@ -28,10 +28,10 @@ 5.4 import de.uapcore.lightpit.dao.DataAccessObject 5.5 import de.uapcore.lightpit.viewmodel.NavMenu 5.6 import de.uapcore.lightpit.viewmodel.View 5.7 +import jakarta.servlet.http.HttpServletRequest 5.8 +import jakarta.servlet.http.HttpServletResponse 5.9 +import jakarta.servlet.http.HttpSession 5.10 import java.util.* 5.11 -import javax.servlet.http.HttpServletRequest 5.12 -import javax.servlet.http.HttpServletResponse 5.13 -import javax.servlet.http.HttpSession 5.14 import kotlin.math.min 5.15 import java.sql.Date as SqlDate 5.16
6.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/AboutServlet.kt Tue Nov 01 21:31:15 2022 +0100 6.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/AboutServlet.kt Wed Dec 28 13:21:30 2022 +0100 6.3 @@ -28,7 +28,7 @@ 6.4 import de.uapcore.lightpit.AbstractServlet 6.5 import de.uapcore.lightpit.HttpRequest 6.6 import de.uapcore.lightpit.dao.DataAccessObject 6.7 -import javax.servlet.annotation.WebServlet 6.8 +import jakarta.servlet.annotation.WebServlet 6.9 6.10 @WebServlet(urlPatterns = ["/about/*"]) 6.11 class AboutServlet : AbstractServlet() {
7.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/ErrorServlet.kt Tue Nov 01 21:31:15 2022 +0100 7.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ErrorServlet.kt Wed Dec 28 13:21:30 2022 +0100 7.3 @@ -26,7 +26,7 @@ 7.4 package de.uapcore.lightpit.servlet 7.5 7.6 import de.uapcore.lightpit.AbstractServlet 7.7 -import javax.servlet.annotation.WebServlet 7.8 +import jakarta.servlet.annotation.WebServlet 7.9 7.10 @WebServlet(urlPatterns = ["/error/*"]) 7.11 class ErrorServlet : AbstractServlet() 7.12 \ No newline at end of file
8.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt Tue Nov 01 21:31:15 2022 +0100 8.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt Wed Dec 28 13:21:30 2022 +0100 8.3 @@ -37,8 +37,8 @@ 8.4 import de.uapcore.lightpit.viewmodel.IssueDiff 8.5 import de.uapcore.lightpit.viewmodel.IssueFeed 8.6 import de.uapcore.lightpit.viewmodel.IssueFeedEntry 8.7 +import jakarta.servlet.annotation.WebServlet 8.8 import java.text.SimpleDateFormat 8.9 -import javax.servlet.annotation.WebServlet 8.10 8.11 8.12 @WebServlet(urlPatterns = ["/feed/*"])
9.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/LanguageServlet.kt Tue Nov 01 21:31:15 2022 +0100 9.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/LanguageServlet.kt Wed Dec 28 13:21:30 2022 +0100 9.3 @@ -30,8 +30,8 @@ 9.4 import de.uapcore.lightpit.HttpRequest 9.5 import de.uapcore.lightpit.dao.DataAccessObject 9.6 import de.uapcore.lightpit.viewmodel.LanguageView 9.7 +import jakarta.servlet.annotation.WebServlet 9.8 import java.util.* 9.9 -import javax.servlet.annotation.WebServlet 9.10 9.11 @WebServlet(urlPatterns = ["/language/*"]) 9.12 class LanguageServlet : AbstractServlet() {
10.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Tue Nov 01 21:31:15 2022 +0100 10.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Wed Dec 28 13:21:30 2022 +0100 10.3 @@ -36,8 +36,8 @@ 10.4 import de.uapcore.lightpit.types.VersionStatus 10.5 import de.uapcore.lightpit.types.WebColor 10.6 import de.uapcore.lightpit.viewmodel.* 10.7 +import jakarta.servlet.annotation.WebServlet 10.8 import java.sql.Date 10.9 -import javax.servlet.annotation.WebServlet 10.10 10.11 @WebServlet(urlPatterns = ["/projects/*"]) 10.12 class ProjectServlet : AbstractServlet() {
11.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/UsersServlet.kt Tue Nov 01 21:31:15 2022 +0100 11.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/UsersServlet.kt Wed Dec 28 13:21:30 2022 +0100 11.3 @@ -33,7 +33,7 @@ 11.4 import de.uapcore.lightpit.entities.User 11.5 import de.uapcore.lightpit.viewmodel.UserEditView 11.6 import de.uapcore.lightpit.viewmodel.UsersView 11.7 -import javax.servlet.annotation.WebServlet 11.8 +import jakarta.servlet.annotation.WebServlet 11.9 11.10 @WebServlet(urlPatterns = ["/users/*"]) 11.11 class UsersServlet : AbstractServlet() {
12.1 --- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Tue Nov 01 21:31:15 2022 +0100 12.2 +++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf Wed Dec 28 13:21:30 2022 +0100 12.3 @@ -38,6 +38,7 @@ 12.4 <li>E-Mail Link in Vorgangsansicht hinzugefügt, wenn der Zugewiesene eine Mailadresse hat.</li> 12.5 <li>Formatierung für Status-Icons hinzugefügt, die als Text eingegeben werden: (/), (x) sowie (!)</li> 12.6 <li>Installationsanweisungen hinzugefügt.</li> 12.7 + <li>Unterstützung für Jakarta EE hinzugefügt und Laufzeitabhängigkeiten entfernt.</li> 12.8 </ul> 12.9 12.10 <h3>Version 0.6</h3>
13.1 --- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf Tue Nov 01 21:31:15 2022 +0100 13.2 +++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf Wed Dec 28 13:21:30 2022 +0100 13.3 @@ -38,6 +38,7 @@ 13.4 <li>Add mailto link in issue view when the assignee has a mail address.</li> 13.5 <li>Add formatting for (/), (x), and (!) status indicators.</li> 13.6 <li>Add install instructions.</li> 13.7 + <li>Add Jakarta EE support and remove runtime dependencies.</li> 13.8 </ul> 13.9 13.10 <h3>Version 0.6</h3>
14.1 --- a/src/main/webapp/WEB-INF/web.xml Tue Nov 01 21:31:15 2022 +0100 14.2 +++ b/src/main/webapp/WEB-INF/web.xml Wed Dec 28 13:21:30 2022 +0100 14.3 @@ -1,6 +1,8 @@ 14.4 <?xml version="1.0" encoding="UTF-8"?> 14.5 -<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 14.6 - xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> 14.7 +<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" 14.8 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 14.9 + xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd" 14.10 + version="6.0"> 14.11 <session-config> 14.12 <session-timeout> 14.13 30