#233 migrate to Jakarta EE and update dependencies

Wed, 28 Dec 2022 13:21:30 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 28 Dec 2022 13:21:30 +0100
changeset 254
55ca6cafc3dd
parent 253
e1cd3e698037
child 255
1270f91b4c22

#233 migrate to Jakarta EE and update dependencies

INSTALL file | annotate | diff | comparison | revisions
build.gradle.kts file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/AbstractServlet.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/DataSourceProvider.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/AboutServlet.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/ErrorServlet.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/LanguageServlet.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/servlet/UsersServlet.kt file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog-de.jspf file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog.jspf file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/web.xml file | annotate | diff | comparison | revisions
--- a/INSTALL	Tue Nov 01 21:31:15 2022 +0100
+++ b/INSTALL	Wed Dec 28 13:21:30 2022 +0100
@@ -19,29 +19,19 @@
 3. Configure a data source in your application servlet or servlet container
 
 You may use absolutely anything: Tomcat, TomEE, Glassfish, Payara, you name it.
+If it supports Servlet 6.0, JSP 3.1, and EL 5.0, you are good to go.
 Just make sure to configure a data source with the name jdbc/lightpit/app.
 If you want another name, you can configure the JNDI resource in the
 WEB-INF/web.xml and META-INF/context.xml files. It is highly recommended to use
 the lightpit_app user which has less privileges to create the data source and
 leave the lightpit_dbo user for the database operator.
 
-4. Make sure JDBC driver and JSTL libraries are available
-
-This step may be optional depending on the container you are using. Most
-application servers already have JSTL libraries installed. More basic servlet
-containers like Tomcat don't. In that case you have to put the libraries of the
-javax.servlet:jstl:1.2 artifact manually into the library dir of your servlet
-container (jstl-1.2.jar and jstl-impl-1.2.jar).
-
-In most cases you also have to put the postgresql JDBC driver into the library
-directory of your server (e.g. postgres-42.x.x.jar).
-
-5. Deploy the WAR file of lightpit
+4. 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.
 
-6. Configuring a web server and authentication
+5. Configuring a web server and authentication
 
 LightPIT can optionally detect the authenticated user. You may freely decide
 whether to enable authentication in your application server or put a web server
--- a/build.gradle.kts	Tue Nov 01 21:31:15 2022 +0100
+++ b/build.gradle.kts	Wed Dec 28 13:21:30 2022 +0100
@@ -1,13 +1,11 @@
 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
 
 plugins {
-    kotlin("jvm") version "1.5.32"
+    kotlin("jvm") version "1.7.21"
     war
 }
 group = "de.uapcore"
-version = "0.6-SNAPSHOT"
-
-val flexmarkVersion = "0.62.2"
+version = "1.0-SNAPSHOT"
 
 repositories {
     mavenCentral()
@@ -32,13 +30,17 @@
     sourceSets {
         val main by getting {
             dependencies {
-                compileOnly("javax.servlet:javax.servlet-api:3.1.0")
-                compileOnly("javax.servlet:jstl:1.2")
+                // 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")
+                compileOnly("jakarta.servlet:jakarta.servlet-api:6.0.0")
+                val flexmarkVersion = "0.64.0"
                 implementation("com.vladsch.flexmark:flexmark:${flexmarkVersion}")
                 implementation("com.vladsch.flexmark:flexmark-util-data:${flexmarkVersion}")
                 implementation("com.vladsch.flexmark:flexmark-ext-tables:${flexmarkVersion}")
                 implementation("com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:${flexmarkVersion}")
-                implementation("io.github.java-diff-utils:java-diff-utils:4.5")
+                implementation("io.github.java-diff-utils:java-diff-utils:4.12")
             }
         }
     }
--- a/src/main/kotlin/de/uapcore/lightpit/AbstractServlet.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/AbstractServlet.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -28,11 +28,11 @@
 import de.uapcore.lightpit.DataSourceProvider.Companion.SC_ATTR_NAME
 import de.uapcore.lightpit.dao.DataAccessObject
 import de.uapcore.lightpit.dao.createDataAccessObject
+import jakarta.servlet.http.HttpServlet
+import jakarta.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletResponse
 import java.sql.SQLException
 import java.util.*
-import javax.servlet.http.HttpServlet
-import javax.servlet.http.HttpServletRequest
-import javax.servlet.http.HttpServletResponse
 
 abstract class AbstractServlet : HttpServlet() {
     
--- a/src/main/kotlin/de/uapcore/lightpit/DataSourceProvider.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/DataSourceProvider.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -25,13 +25,13 @@
 
 package de.uapcore.lightpit
 
+import jakarta.servlet.ServletContextEvent
+import jakarta.servlet.ServletContextListener
+import jakarta.servlet.annotation.WebListener
 import java.sql.SQLException
 import javax.naming.Context
 import javax.naming.InitialContext
 import javax.naming.NamingException
-import javax.servlet.ServletContextEvent
-import javax.servlet.ServletContextListener
-import javax.servlet.annotation.WebListener
 import javax.sql.DataSource
 
 /**
--- a/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/RequestMapping.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -28,10 +28,10 @@
 import de.uapcore.lightpit.dao.DataAccessObject
 import de.uapcore.lightpit.viewmodel.NavMenu
 import de.uapcore.lightpit.viewmodel.View
+import jakarta.servlet.http.HttpServletRequest
+import jakarta.servlet.http.HttpServletResponse
+import jakarta.servlet.http.HttpSession
 import java.util.*
-import javax.servlet.http.HttpServletRequest
-import javax.servlet.http.HttpServletResponse
-import javax.servlet.http.HttpSession
 import kotlin.math.min
 import java.sql.Date as SqlDate
 
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/AboutServlet.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/AboutServlet.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -28,7 +28,7 @@
 import de.uapcore.lightpit.AbstractServlet
 import de.uapcore.lightpit.HttpRequest
 import de.uapcore.lightpit.dao.DataAccessObject
-import javax.servlet.annotation.WebServlet
+import jakarta.servlet.annotation.WebServlet
 
 @WebServlet(urlPatterns = ["/about/*"])
 class AboutServlet : AbstractServlet() {
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/ErrorServlet.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ErrorServlet.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -26,7 +26,7 @@
 package de.uapcore.lightpit.servlet
 
 import de.uapcore.lightpit.AbstractServlet
-import javax.servlet.annotation.WebServlet
+import jakarta.servlet.annotation.WebServlet
 
 @WebServlet(urlPatterns = ["/error/*"])
 class ErrorServlet : AbstractServlet()
\ No newline at end of file
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/FeedServlet.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -37,8 +37,8 @@
 import de.uapcore.lightpit.viewmodel.IssueDiff
 import de.uapcore.lightpit.viewmodel.IssueFeed
 import de.uapcore.lightpit.viewmodel.IssueFeedEntry
+import jakarta.servlet.annotation.WebServlet
 import java.text.SimpleDateFormat
-import javax.servlet.annotation.WebServlet
 
 
 @WebServlet(urlPatterns = ["/feed/*"])
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/LanguageServlet.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/LanguageServlet.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -30,8 +30,8 @@
 import de.uapcore.lightpit.HttpRequest
 import de.uapcore.lightpit.dao.DataAccessObject
 import de.uapcore.lightpit.viewmodel.LanguageView
+import jakarta.servlet.annotation.WebServlet
 import java.util.*
-import javax.servlet.annotation.WebServlet
 
 @WebServlet(urlPatterns = ["/language/*"])
 class LanguageServlet : AbstractServlet() {
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -36,8 +36,8 @@
 import de.uapcore.lightpit.types.VersionStatus
 import de.uapcore.lightpit.types.WebColor
 import de.uapcore.lightpit.viewmodel.*
+import jakarta.servlet.annotation.WebServlet
 import java.sql.Date
-import javax.servlet.annotation.WebServlet
 
 @WebServlet(urlPatterns = ["/projects/*"])
 class ProjectServlet : AbstractServlet() {
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/UsersServlet.kt	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/servlet/UsersServlet.kt	Wed Dec 28 13:21:30 2022 +0100
@@ -33,7 +33,7 @@
 import de.uapcore.lightpit.entities.User
 import de.uapcore.lightpit.viewmodel.UserEditView
 import de.uapcore.lightpit.viewmodel.UsersView
-import javax.servlet.annotation.WebServlet
+import jakarta.servlet.annotation.WebServlet
 
 @WebServlet(urlPatterns = ["/users/*"])
 class UsersServlet : AbstractServlet() {
--- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Wed Dec 28 13:21:30 2022 +0100
@@ -38,6 +38,7 @@
     <li>E-Mail Link in Vorgangsansicht hinzugefügt, wenn der Zugewiesene eine Mailadresse hat.</li>
     <li>Formatierung für Status-Icons hinzugefügt, die als Text eingegeben werden: (/), (x) sowie (!)</li>
     <li>Installationsanweisungen hinzugefügt.</li>
+    <li>Unterstützung für Jakarta EE hinzugefügt und Laufzeitabhängigkeiten entfernt.</li>
 </ul>
 
 <h3>Version 0.6</h3>
--- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Wed Dec 28 13:21:30 2022 +0100
@@ -38,6 +38,7 @@
     <li>Add mailto link in issue view when the assignee has a mail address.</li>
     <li>Add formatting for (/), (x), and (!) status indicators.</li>
     <li>Add install instructions.</li>
+    <li>Add Jakarta EE support and remove runtime dependencies.</li>
 </ul>
 
 <h3>Version 0.6</h3>
--- a/src/main/webapp/WEB-INF/web.xml	Tue Nov 01 21:31:15 2022 +0100
+++ b/src/main/webapp/WEB-INF/web.xml	Wed Dec 28 13:21:30 2022 +0100
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
+<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
+         version="6.0">
     <session-config>
         <session-timeout>
             30

mercurial