jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
https://eclipse.dev/jetty
Other
3.86k stars 1.91k forks source link

Provide a replacement for jetty-runner #10854

Open gregw opened 1 year ago

gregw commented 1 year ago

Jetty version(s) 12

Enhancement Description

Having a single jar web server is a convenience that many users desire. See #1905, #4562 and #4563 We should either provide a simple one for each eeX environment or a process that can create one for a specific configuration.

joakime commented 1 year ago

Make jetty's start.jar include all of the libs + modules + etc inside the jar.

Then it's just a matter of start.jar --module=http,ee10-deploy http.server.port=8080 --deploy=foo.war and if they want something more complicated they can just do start.jar --module=http,ee10-deploy http.server.port=8080 --deploy=foo.xml custom-ssl.xml jdbc-jndi.xml

Call this new thing something like start-embedded.jar which has no jpms support.

Thing is, this CANNOT be deployed to maven central, as it'll just wind up being a dependency in some projects, and that will cause duplicate classes issues. There would be no way to override servlet, or jsp, or jstl, or websocket, etc...

And i'm dubious we would even be allowed to create + deploy such a complicated beast (license wise)

joakime commented 1 year ago

A normal uber jar will not be a good solution for Jetty 12. As we would have conflicting deps on things like jakarta.servlet and whatnot across the environments.

We would have to isolate each environment away from the prying eyes of Java. Using the shader plugin and rewriting the environment dependencies (ie: servlet, jsp, jstl, etc) wouldn't help either, as the webapps wouldn't be able to use those classes then.

Moving those 3rd party environment jars into something like META-INF/jetty/environments/ee#/<groupId>/<artifactId>/<version>/ and having a unique classloader that understands this structure might work. (bonus is that the start.jar maven://<groupId>/<artifactId>/<version> syntax in the module files can still work.)

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.