Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Documented the new web application deployer. #13084

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

Open
wants to merge 2 commits into
base: jetty-12.1.x
Choose a base branch
from

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented May 2, 2025

No description provided.

@sbordet sbordet requested review from gregw and joakime May 2, 2025 10:22
@sbordet sbordet moved this to 👀 In review in Jetty 12.1.0 May 2, 2025
@sbordet sbordet requested a review from lorban May 2, 2025 16:29
@@ -1,5 +1,6 @@
[description]
This module enables the direct Deployer, which simply adds and starts a context.
This module enables the standard Deployer, which adds and starts ContextHandler
instances produced by the deployment-scanner module.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
instances produced by the deployment-scanner module.
instances. This module is used by the deployment-scanner module to deploy the web applications it discovers.

Copy link
Contributor Author

@sbordet sbordet May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it less. The fact that ContextHandler instances are produced by deployment-scanner is lost in your proposal.

@@ -19,4 +20,4 @@ etc/jetty-deployer-standard.xml
[ini-template]

## Should redeploys be atomic (may have two instances running simultaneously)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Should redeploys be atomic (may have two instances running simultaneously)
## Atomic redeploy. A new instance is started and exchanged with the current, before the current is stopped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrote an alternative which should be better.

@@ -1,5 +1,5 @@
[description]
This module enables web application context scanning of the `$JETTY_BASE/webapps` directory.
This module enables scanning of the `$JETTY_BASE/webapps` directory to deploy web applications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This module enables scanning of the `$JETTY_BASE/webapps` directory to deploy web applications.
This module enables scanning of the `$JETTY_BASE/webapps` directory to deploy web applications discovered in the scanned deployment directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrote a shorter alternative to your proposal.

# tag::description[]
Scans and deploys `static` content from `$JETTY_BASE/webapps/` directory.
# end::description[]
Scans and deploys Jetty `static` environment web applications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static doesn't really deploy applications, at least not in our sense of the word

Suggested change
Scans and deploys Jetty `static` environment web applications.
Scans and deploys directories that are to be served statically by Jetty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gregw it actually does deploy a web application, in our sense of a ContextHandler being made available, with a contextPath, etc.
Users won't be able to figure out whether it is static files or generated by the servlet, so they will think they hit a web application deployed on the server.

@@ -1,5 +1,6 @@
[description]
This module enables the direct Deployer, which simply adds and starts a context.
This module enables the standard Deployer, which adds and starts ContextHandler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? What is the deployer-standard module? How is this different to the deployment-scanner module? Shouldn't we have just one deployer module, and if users want something different they come up with their own module that configures their own Scanner etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janbartel deployer-scanner scans and creates the ContextHandler (subclass); deployer-standard links that ContextHandler to the server.

Before linking it to the server, another module may decorate it or reconfigure it.

@@ -13,108 +13,258 @@

= Web Application Deployment

The Jetty Web Application Deployment mechanism provides for:
The Jetty server deploys each web application to a specific _environment_.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Jetty server deploys each web application to a specific _environment_.
Jetty deploys each web application to a specific _environment_.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, no. "Jetty" is not defined (typically refers to the project), we have client and server, so it's really "The Jetty server".

----

The contents of the `$JETTY_BASE/etc/{ee-current}-context.xml` then `$JETTY_BASE/etc/{ee-current}-feature.xml` files will be applied to the `wiki` webapp instance _before_ `wiki.xml`, allowing the contents of the latter to override the contents of the former.
[[jetty-web-xml]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't document the jetty-web.xml files in the section on deployment. It has nothing to do with deployment, it concerns only webapp startup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to know the existence of this feature if you want to properly prepare your application for deployment.

Is there a "webapp startup" documentation? If not, here would be the best place for now.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet requested review from gregw and janbartel May 6, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

3 participants