Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Jetty packages (major) #103

Draft
wants to merge 27 commits into
base: helma-🐜
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1cf7387
Update Jetty packages
renovate[bot] May 18, 2024
ed575bc
Update README.md
p3k May 19, 2024
c5f6801
Merge branch 'helma-🐜' into renovate/major-jetty-packages
p3k May 19, 2024
c087cb7
Use correct version of Jetty servlet
p3k May 25, 2024
a943124
Fix creating Jetty server from config file
p3k May 25, 2024
26975a1
Method ServerConnector.setSoLingerTime() was removed
p3k May 25, 2024
62630ae
Modernize for loop
p3k May 25, 2024
0165e7c
Fix setup of static resource
p3k May 25, 2024
304ea4e
Fix creation of app context
p3k May 25, 2024
fa59a27
Fix creation of protected context
p3k May 25, 2024
d67d023
Prevent java.lang.IllegalStateException: Shared scheduler not started
p3k May 25, 2024
441d952
Prevent incompatible types: ServletContextHandler cannot be converted…
p3k May 25, 2024
973b349
Prevent java.lang.IllegalArgumentException: Resource String is invalid
p3k May 25, 2024
3dbcd79
Migrate to Jakarte servlet API 5
p3k May 25, 2024
90e45c9
Migrate to Apache file upload API 2 w/ Jakarta
p3k May 25, 2024
79d8338
Use canonical paths when creating static contexts
p3k May 25, 2024
9143faf
Add release action
p3k May 30, 2024
1e32c8e
Merge remote-tracking branch 'origin/helma-🐜' into renovate/major-jet…
p3k May 30, 2024
9e870e6
Slightly modify the format of the build date
p3k Jun 15, 2024
84abcde
Update run configuration to always use the correct dependencies
p3k Jun 15, 2024
ffb259a
Slightly modify the version string (still a date representation)
p3k Jun 15, 2024
45b19e3
Reorder the tasks
p3k Jun 15, 2024
6401300
Decouple update task from install
p3k Jun 15, 2024
3e5af06
Add setup for Gradle debugging in VS Codium
p3k Jun 15, 2024
51bc14c
Remove over-complicated launch and tasks configuration in favor of Gr…
p3k Jun 15, 2024
b1296fb
Merge branch 'helma-🐜' into renovate/major-jetty-packages
p3k Jun 15, 2024
1925916
Bump required minimum Java version to 17
p3k Jun 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"vscjava.vscode-java-pack"
"vscjava.vscode-java-pack",
"vscjava.vscode-gradle"
]
}
84 changes: 0 additions & 84 deletions .vscode/launch.json

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ Helma is built with [Gradle](https://gradle.org), the build task depends on the

### Additional Prerequisites

* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
* [Node.js](https://nodejs.org) LTS version
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0

Clone this repository to your machine and run Helma with `./gradlew run`.

Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `yes` or `no`.
To update the installation from a build, run `./gradlew update` and enter `yes` at the prompt.

> ⚠️
> Please be aware that this step is going to overwrite files in the installation directory – escpecially at a later time when there might be substantial changes. Should this happen by accident you find the previous installation in the `backups` directory.
Expand Down
89 changes: 49 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ def textFiles = ['**/*.hac', '**/.html', '**/*.js', '**/*.md', '**/*.properties'
allprojects {
apply plugin: 'java'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
}
}

version = new Date().format("yyyyMMdd")
version = new Date().format("yy.M.d")

tasks.build.dependsOn javadoc, 'jsdoc', 'generateLicenseReport'
tasks.compileJava.dependsOn 'processSource'
Expand Down Expand Up @@ -58,14 +58,15 @@ configurations {
dependencies {
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'commons-codec:commons-codec:1.17.0'
implementation 'commons-fileupload:commons-fileupload:1.5'
implementation 'org.apache.commons:commons-fileupload2-core:2.0.0-M2'
implementation 'org.apache.commons:commons-fileupload2-jakarta:2.0.0-M1'
implementation 'commons-logging:commons-logging:1.3.2'
implementation 'commons-net:commons-net:3.10.0'
implementation 'com.sun.mail:javax.mail:1.6.2'
implementation 'javax.servlet:javax.servlet-api:4.0.1'
implementation 'jakarta.servlet:jakarta.servlet-api:5.0.0'
implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
implementation 'org.eclipse.jetty:jetty-servlet:9.4.54.v20240208'
implementation 'org.eclipse.jetty:jetty-xml:9.4.54.v20240208'
implementation 'org.eclipse.jetty.ee9:jetty-ee9-servlet:12.0.9'
implementation 'org.eclipse.jetty:jetty-xml:12.0.9'
implementation 'org.mozilla:rhino:1.7.13'
implementation 'org.sejda.imageio:webp-imageio:0.1.6'
implementation 'xerces:xercesImpl:2.12.2'
Expand All @@ -76,32 +77,14 @@ def rhinoJar = configurations.library.files.find { jar ->
jar.name.startsWith('rhino')
}

startScripts {
applicationName = 'helma'
classpath = files('../launcher.jar')
mainClass = 'helma.main.launcher.Main'

defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon]

doLast {
// Work-around to make the classpath above work (launcher.jar is located outside of `lib` dir)
// See https://discuss.gradle.org/t/classpath-in-application-plugin-is-building-always-relative-to-app-home-lib-directory/2012
def unixScriptFile = file getUnixScript()
def windowsScriptFile = file getWindowsScript()
unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib', '$APP_HOME')
windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib', '%APP_HOME%')
}
}

distributions {
main {
contents {
from project(':launcher').jar
}
}
run {
jvmArgs jettyLogLevel, suppressMacosDockIcon
classpath += fileTree(dir: 'lib/ext', include: '*.jar')
}

application {
mainClass = 'helma.main.Server'

applicationDistribution.from(projectDir) {
include 'modules/**'
include 'LICENSE.md'
Expand All @@ -125,6 +108,31 @@ application {
}
}

startScripts {
applicationName = 'helma'
classpath = files('../launcher.jar')
mainClass = 'helma.main.launcher.Main'

defaultJvmOpts = [jettyLogLevel, suppressMacosDockIcon]

doLast {
// Work-around to make the classpath above work (launcher.jar is located outside of `lib` dir)
// See https://discuss.gradle.org/t/classpath-in-application-plugin-is-building-always-relative-to-app-home-lib-directory/2012
def unixScriptFile = file getUnixScript()
def windowsScriptFile = file getWindowsScript()
unixScriptFile.text = unixScriptFile.text.replace('$APP_HOME/lib', '$APP_HOME')
windowsScriptFile.text = windowsScriptFile.text.replace('%APP_HOME%\\lib', '%APP_HOME%')
}
}

distributions {
main {
contents {
from project(':launcher').jar
}
}
}

distTar {
dependsOn ':generateLicenseReport', ':javadoc', ':jsdoc'

Expand All @@ -145,19 +153,10 @@ distZip {

installDist {
dependsOn build

if (!System.getenv('CI')) {
finalizedBy 'update'
}
}

run {
classpath = files('launcher.jar')
jvmArgs jettyLogLevel, suppressMacosDockIcon
}

task processSource(type: Sync) {
def date = new Date().format("MMMM dd, yyyy")
def date = new Date().format("d MMMM yyyy")
def gitOutput = new ByteArrayOutputStream()

exec {
Expand All @@ -181,6 +180,8 @@ task processSource(type: Sync) {
}

task update {
dependsOn installDist

def rsyncArgs = ['--archive', '--filter', '- backups']

def confirm = {
Expand Down Expand Up @@ -290,3 +291,11 @@ task commandLine(type: JavaExec) {
mainClass = 'helma.main.launcher.Commandline'
args '-h', projectDir, function
}

tasks.register('debug', JavaExec) {
group = 'application'
main = 'helma.main.Server'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005']
classpath += fileTree(dir: 'lib/ext', include: '*.jar')
}
2 changes: 1 addition & 1 deletion src/main/java/helma/framework/CookieTrans.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package helma.framework;

import java.io.Serializable;
import javax.servlet.http.Cookie;
import jakarta.servlet.http.Cookie;

/**
* Cookie Transmitter. A simple, serializable representation
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/helma/framework/RequestBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package helma.framework;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.io.Serializable;
import java.util.Map;

/**
*
*
*/
public class RequestBean implements Serializable {
private static final long serialVersionUID = -6826881712426326687L;
Expand Down Expand Up @@ -89,7 +89,7 @@ public HttpServletRequest getServletRequest() {
* @return the header value, or null
*/
public String getHeader(String name) {
return req.getHeader(name);
return req.getHeader(name);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/helma/framework/RequestTrans.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import helma.util.SystemMap;
import helma.util.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.Cookie;

import org.apache.commons.codec.binary.Base64;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/helma/framework/ResponseBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import helma.objectmodel.db.Transactor;
import helma.scripting.ScriptingException;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.io.StringWriter;
import java.io.PrintWriter;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/helma/framework/ResponseTrans.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import helma.util.*;
import helma.scripting.ScriptingException;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import java.io.*;
import java.security.*;
import java.util.*;
Expand Down
Loading
Loading