Skip to content

Commit

Permalink
Fix #10411 simpler default environment
Browse files Browse the repository at this point in the history
update documentation
  • Loading branch information
gregw committed Aug 29, 2023
1 parent cc1d2e4 commit de46662
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ A simple Jetty context XML file, for example named `wiki.xml` is the following:
<2> Specifies the web application `contextPath`, which may be different from the `+*.war+` file name.
<3> Specifies the file system path of the `+*.war+` file.

The Jetty content XML file must be accompanied by a `+*.properties+` file that specifies the xref:og-deploy[environment] to use for the deployment:
The Jetty content XML file may be accompanied by a `+*.properties+` file that specifies the xref:og-deploy[environment] to use for the deployment:

.wiki.properties
[source,properties,subs=attributes]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,30 @@ This allows the XML file to reference the `+*.war+` file and avoid that the web
[[og-deploy-rules-environment]]
===== Environment Resolution

A web application is always deployed to a specific environment.
A web application is always deployed to a specific environment, which is either be configured for the deployed application or set to the default environment.

If you enabled only one specific deployer module, for example `{ee-current}-deploy`, then the web applications and the Jetty context XML files in `$JETTY_BASE/webapps` will be deployed to the `{ee-current}` environment.
If only a single specific deployer module is enabled, for example `{ee-current}-deploy`, then it is the default environment and applications will be deployed to it without any additional configuration.

You can enable simultaneously multiple deployer modules if you need to deploy multiple web applications each to a specific environment.
If multiple deployer modules are enabled, then the default environment is:

For example, you have an `old-ee9.war` web application that you want to deploy to the Jakarta EE 9 environment, and a `new-{ee-current}.war` web application that you want to deploy to the Jakarta {ee-current-caps} environment.
First, you must enable both the `ee9-deploy` and the `{ee-current}-deploy` modules.
Then, you add a `+*.properties+` file with the same name of the web application, in the example above `$JETTY_BASE/webapps/old-ee9.properties`, with the following content:
* The most recent of EE environment if any EE deployer modules are enabled
* otherwise the core environment, if the core deployer module is enabled.

.old-ee9.properties
For example, if `core-deploy`, `ee9-deploy` and the `{ee-current}-deploy` modules are enabled, then `{ee-current}` is the default environment, to which applications will be deployed unless otherwise configured.

To configure a specific environment for an application, you add a `+*.properties+` file with the same name of the web application. For example, an application deployed to `$JETTY_BASE/webapps/my-ee9-app.war` is configured with the file `$JETTY_BASE/webapps/my-ee9-app.properties`, with the following content:

.my-ee9-app.properties
[source,properties]
----
environment=ee9
----

In case of simultaneous multiple environments, it is good practice to always specify the `+*.properties+` file for your web applications.
In case of simultaneous multiple deployer environments, it is good practice to always specify the `+*.properties+` file for your web applications.

[CAUTION]
====
If you do *not* specify the `+*.properties+` file for your web applications, then the deployer for the most recent EE version will be used.
If you do *not* specify the `+*.properties+` file for your web applications, then the deployer for the default environment will be used.
For example, if you have enabled the EE deployer Jetty module for all EE versions, and you deploy an EE 9 web application _without_ the `+*.properties+` file, then it will be deployed by the {ee-current-caps} deployer, with unspecified results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface Deployable
return 1;
}
if (m2.matches())
return -11;
return -1;

return e1.compareTo(e2);
};
Expand Down

0 comments on commit de46662

Please sign in to comment.