Skip to content

Commit

Permalink
Issue #11424 - Inverting meaning - static deployment is default
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Feb 22, 2024
1 parent e8b9a82 commit 24a937f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@

The `DeploymentManager` scans the `$JETTY_BASE/webapps` directory for changes every `N` seconds, where `N` is configured via the `jetty.deploy.scanInterval` property.

By default, the scan interval is `1` second, which means that _hot_ deployment is enabled: if a file is added/changed/removed from the `$JETTY_BASE/webapps` directory, the `DeploymentManager` will notice the change and respectively deploy/redeploy/undeploy the web application.

Setting the scan interval to `0` means that _static_ deployment is enabled, and the `DeploymentManager` will not scan the `$JETTY_BASE/webapps` directory for changes.
By default, the scan interval is `0` seconds, which means _static_ deployment, and the `DeploymentManager` will not scan the `$JETTY_BASE/webapps` directory for changes.
This means that to deploy/redeploy/undeploy a web application you will need to stop and restart Jetty.

The following command line disables _hot_ deployment by specifying the `jetty.deploy.scanInterval` property on the command line, and therefore only for this particular run:
Setting the scan interval to a value of `1` second (or greater) means that _hot_ deployment is enabled: if a file is added/changed/removed from the `$JETTY_BASE/webapps` directory, the `DeploymentManager` will notice the change and respectively deploy/redeploy/undeploy the web application.

The following command line enables _hot_ deployment by specifying the `jetty.deploy.scanInterval` property on the command line, and therefore only for this particular run:

----
$ java -jar $JETTY_HOME/start.jar jetty.deploy.scanInterval=0
$ java -jar $JETTY_HOME/start.jar jetty.deploy.scanInterval=1
----

To make _static_ deployment persistent, you need to edit the appropriate `<env>-deploy` module configuration file, `$JETTY_BASE/start.d/<env>-deploy.ini` (eg: `ee10-deploy.ini`), uncomment the module property `jetty.deploy.scanInterval` and change its value to `0`:
To make _hot_ deployment persistent, you need to edit the appropriate `<env>-deploy` module configuration file, `$JETTY_BASE/start.d/<env>-deploy.ini` (eg: `ee10-deploy.ini`), uncomment the module property `jetty.deploy.scanInterval` and change the value to `1` second (or greater):

.<env>-deploy.ini
[source,subs="verbatim,quotes"]
----
--module=deploy
#jetty.deploy.scanInterval=0#
#jetty.deploy.scanInterval=1#
...
----
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ contextHandlerClass?=org.eclipse.jetty.server.handler.ResourceHandler$ResourceCo
# jetty.deploy.deferInitialScan=false

## Monitored directory scan period (seconds)
# jetty.deploy.scanInterval=1
# jetty.deploy.scanInterval=0

## Default ContextHandler class for core deployments
# contextHandlerClass=org.eclipse.jetty.server.handler.ResourceHandler$ResourceContext
2 changes: 1 addition & 1 deletion jetty-core/jetty-server/src/main/config/modules/server.mod
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ etc/jetty.xml
# end::documentation-scheduler-config[]

## Whether the handlers of the ContextHandlerCollection can be updated once the server is started
## If set to false, then eeN-deploy module jetty.deploy.scanInterval should also be set to 0.
## If set to false, then <env>-deploy module jetty.deploy.scanInterval should also be set to 0.
# jetty.server.contexts.dynamic=true

## Should the DefaultHandler serve the jetty favicon.ico from the root.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ etc/jetty-ee10-deploy.xml
# jetty.deploy.defaultsDescriptorPath=${jetty.base}/etc/webdefault-ee10.xml

## Monitored directory scan period (seconds)
# jetty.deploy.scanInterval=1
# jetty.deploy.scanInterval=0

## Whether to extract *.war files
# jetty.deploy.extractWars=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ etc/jetty-ee8-deploy.xml
# jetty.deploy.defaultsDescriptorPath=${jetty.base}/etc/webdefault-ee8.xml

## Monitored directory scan period (seconds)
# jetty.deploy.scanInterval=1
# jetty.deploy.scanInterval=0

## Whether to extract *.war files
# jetty.deploy.extractWars=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ etc/jetty-ee9-deploy.xml
# jetty.deploy.defaultsDescriptorPath=${jetty.base}/etc/webdefault-ee9.xml

## Monitored directory scan period (seconds)
# jetty.deploy.scanInterval=1
# jetty.deploy.scanInterval=0

## Whether to extract *.war files
# jetty.deploy.extractWars=true
Expand Down

0 comments on commit 24a937f

Please sign in to comment.