Using consistently --add-modules everywhere.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2023-07-11 12:35:29 +02:00
parent 9567ade30f
commit c05bfd020e
No known key found for this signature in database
GPG Key ID: 1677D141BCF3584D
12 changed files with 34 additions and 40 deletions

View File

@ -138,7 +138,7 @@ $ java -jar $JETTY_HOME/start.jar --list-modules=demo
You can enable a module, for example the `http` module:
----
$ java -jar $JETTY_HOME/start.jar --add-module=http
$ java -jar $JETTY_HOME/start.jar --add-modules=http
----
Once you have one or more module enabled, you can display the current configuration, to verify that the configuration is correct:
@ -150,7 +150,7 @@ $ java -jar $JETTY_HOME/start.jar --list-config
You can enable a Jetty demo module, which will deploy a demo web application:
----
$ java -jar $JETTY_HOME/start.jar --add-module=demo-simple
$ java -jar $JETTY_HOME/start.jar --add-modules=demo-simple
----
Finally, you can start Jetty:

View File

@ -65,12 +65,12 @@ Refer to the section about xref:og-deploy[deployment] for further information ab
[subs=attributes]
----
$ java -jar $JETTY_HOME/start.jar --add-module={ee-current}-deploy
$ java -jar $JETTY_HOME/start.jar --add-modules={ee-current}-deploy
----
[source,options=nowrap]
----
include::jetty[setupArgs="--add-module=http",args="--add-module={ee-current}-deploy"]
include::jetty[setupArgs="--add-modules=http",args="--add-modules={ee-current}-deploy"]
----
The `{ee-current}-deploy` module creates `$JETTY_BASE/webapps`, which is the directory where Jetty looks for any `+*.war+` files or web application directories to deploy.
@ -84,7 +84,7 @@ You can use one of the demos shipped with Jetty:
[subs=attributes]
----
$ java -jar $JETTY_HOME/start.jar --add-module={ee-current}-demo-simple
$ java -jar $JETTY_HOME/start.jar --add-modules={ee-current}-demo-simple
----
The `$JETTY_BASE` directory is now:

View File

@ -52,12 +52,12 @@ Now try to enable the xref:og-protocols-http[`http`] module.
NOTE: If you want to enable support for protocols like secure HTTP/1.1 or HTTP/2 or HTTP/3, or want to configure Jetty behind a load balancer, read xref:og-protocols[this section].
----
$ java -jar $JETTY_HOME/start.jar --add-module=http
$ java -jar $JETTY_HOME/start.jar --add-modules=http
----
[source,subs=quotes,options=nowrap]
----
include::jetty[args="--add-module=http",highlight="([a-z\-]+ *transitively enabled)"]
include::jetty[args="--add-modules=http",highlight="([a-z\-]+ *transitively enabled)"]
----
When Jetty enables the `http` module, it also automatically enables a number of transitive dependencies of the `http` module, such as the `server` module, the `logging-jetty` module, and so on.

View File

@ -17,7 +17,7 @@
As with many other Jetty features, local JMX support is enabled with the xref:og-module-jmx[`jmx` Jetty module]:
----
$ java -jar $JETTY_HOME/start.jar --add-module=jmx
$ java -jar $JETTY_HOME/start.jar --add-modules=jmx
----
With the `jmx` Jetty module enabled, Jetty components will be exported as JMX _MBeans_ to the JVM platform `MBeanServer`, so that they can be accessed by JMX compliant tools.

View File

@ -40,7 +40,7 @@ Then, the client uses the RMI stub to connect to the RMI server, typically to a
Remote access to the platform MBeans, and therefore the Jetty MBeans, is enabled by the `jmx-remote` Jetty module:
----
$ java -jar $JETTY_HOME/start.jar --add-module=jmx-remote
$ java -jar $JETTY_HOME/start.jar --add-modules=jmx-remote
----
This command creates the `jmx-remote.ini` file:
@ -155,7 +155,7 @@ The simplest way to control JMX authentication and authorization is to specify t
This is achieved by enabling the `jmx-remote-auth` Jetty module:
----
$ java -jar $JETTY_HOME/start.jar --add-module=jmx-remote-auth
$ java -jar $JETTY_HOME/start.jar --add-modules=jmx-remote-auth
----
Enabling the `jmx-remote-auth` Jetty module creates the following files:
@ -199,7 +199,7 @@ The JMX communication via RMI happens by default in clear-text, but it is possib
If you want to reuse the configuration that you are using for the xref:og-protocols-https[`https` module], you can just enable the `jmx-remote-ssl.xml` Jetty module:
----
$ java -jar $JETTY_HOME/start.jar --add-module=jmx-remote-ssl
$ java -jar $JETTY_HOME/start.jar --add-modules=jmx-remote-ssl
----
[NOTE]

View File

@ -17,20 +17,12 @@
Clear text HTTP/1.1 is enabled with the `http` Jetty module with the following command (issued from within the `$JETTY_BASE` directory):
----
$ java -jar $JETTY_HOME/start.jar --add-module=http
$ java -jar $JETTY_HOME/start.jar --add-modules=http
----
[source,subs=quotes,options=nowrap]
----
INFO : mkdir ${jetty.base}/start.d
INFO : server transitively enabled, ini template available with --add-module=server
INFO : logging-jetty transitively enabled
INFO : http initialized in ${jetty.base}/start.d/http.ini
INFO : resources transitively enabled
INFO : threadpool transitively enabled, ini template available with --add-module=threadpool
INFO : logging/slf4j dynamic dependency of logging-jetty
INFO : bytebufferpool transitively enabled, ini template available with --add-module=bytebufferpool
INFO : mkdir ${jetty.base}/resources
INFO : copy ${jetty.home}/modules/logging/jetty/resources/jetty-logging.properties to ${jetty.base}/resources/jetty-logging.properties
INFO : Base directory was modified
include::jetty[setupArgs="--add-modules=http"]
----
After having enabled the `http` module, the `$JETTY_BASE` directory looks like this:
@ -53,7 +45,7 @@ Some parameters that you may want to configure are in fact common HTTP parameter
You can force the creation of the `server.ini` file via:
----
$ java -jar $JETTY_HOME/start.jar --add-module=server
$ java -jar $JETTY_HOME/start.jar --add-modules=server
----
Now the `$JETTY_BASE` directory looks like this:

View File

@ -73,18 +73,18 @@ In the example above, the intermediary added the `Forwarded` header specifying t
Let's assume you have already configured Jetty with the HTTP/1.1 protocol with the following command (issued from within the `$JETTY_BASE` directory):
----
$ java -jar $JETTY_HOME/start.jar --add-module=http
$ java -jar $JETTY_HOME/start.jar --add-modules=http
----
Support for the `Forwarded` HTTP header (and its predecessor `X-Forwarded-*` headers) is enabled with the `http-forwarded` Jetty module:
----
$ java -jar $JETTY_HOME/start.jar --add-module=http-forwarded
$ java -jar $JETTY_HOME/start.jar --add-modules=http-forwarded
----
[source,options=nowrap]
----
include::jetty[setupArgs="--add-module=http",args="--add-module=http-forwarded"]
include::jetty[setupArgs="--add-modules=http",args="--add-modules=http-forwarded"]
----
With the `http-forwarded` Jetty module enabled, Jetty interprets the `Forwarded` header and makes its information available to web applications via the standard Servlet APIs.
@ -113,18 +113,18 @@ Support for the proxy protocol can be enabled for the clear-text connector or fo
Let's assume you have already configured Jetty with the HTTP/1.1 clear-text protocol with the following command (issued from within the `$JETTY_BASE` directory):
----
$ java -jar $JETTY_HOME/start.jar --add-module=http
$ java -jar $JETTY_HOME/start.jar --add-modules=http
----
To enable proxy protocol support for the clear-text connector, enable the `proxy-protocol` Jetty module:
----
$ java -jar $JETTY_HOME/start.jar --add-module=proxy-protocol
$ java -jar $JETTY_HOME/start.jar --add-modules=proxy-protocol
----
[source,options=nowrap]
----
include::jetty[setupArgs="--add-module=http",args="--add-module=proxy-protocol"]
include::jetty[setupArgs="--add-modules=http",args="--add-modules=proxy-protocol"]
----
Starting Jetty yields:
@ -146,18 +146,18 @@ Enabling proxy protocol support for the secure connector is similar.
Let's assume you have already configured Jetty with the HTTP/1.1 secure protocol and the test KeyStore with the following command (issued from within the `$JETTY_BASE` directory):
----
$ java -jar $JETTY_HOME/start.jar --add-module=https,test-keystore
$ java -jar $JETTY_HOME/start.jar --add-modules=https,test-keystore
----
Enable the `proxy-protocol-ssl` Jetty module with the following command (issued from within the `$JETTY_BASE` directory):
----
$ java -jar $JETTY_HOME/start.jar --add-module=proxy-protocol-ssl
$ java -jar $JETTY_HOME/start.jar --add-modules=proxy-protocol-ssl
----
[source,options=nowrap]
----
include::jetty[setupArgs="--add-module=https",args="--add-module=proxy-protocol-ssl"]
include::jetty[setupArgs="--add-modules=https",args="--add-modules=proxy-protocol-ssl"]
----
Starting Jetty yields:

View File

@ -71,7 +71,7 @@ You want to create the `$JETTY_BASE/etc/tls-config.xml` with the following templ
The `tls-config.xml` file references the `sslContextFactory` component (created by the `ssl` Jetty module) that configures the KeyStore and TLS parameters, so that you can now call its APIs via XML, and you will have full flexibility for any advanced configuration you want (see below for few examples).
Refer to the link:{javadoc-url}/org/eclipse/jetty/util/ssl/SslContextFactory.html[SslContextFactory javadocs] for the list of methods that you can call through the Jetty XML file.
Refer to the link:{javadoc-url}/org/eclipse/jetty/util/ssl/SslContextFactory.Server.html[SslContextFactory.Server javadocs] for the list of methods that you can call through the Jetty XML file.
CAUTION: Use module properties whenever possible, and only resort to use a Jetty XML file for advanced configuration that you cannot do using module properties.
@ -156,7 +156,7 @@ Jetty can be configured to monitor the directory of the KeyStore file, and reloa
This feature can be enabled by activating the `ssl-reload` Jetty module:
----
$ java -jar $JETTY_HOME/start.jar --add-module=ssl-reload
$ java -jar $JETTY_HOME/start.jar --add-modules=ssl-reload
----
For more information about the configuration of the `ssl-reload` Jetty module, see xref:og-module-ssl-reload[this section].
@ -175,7 +175,7 @@ CAUTION: As Conscrypt eventually binds to a native library, there is a higher ri
To use Conscrypt as the TLS provider just enable the `conscrypt` Jetty module:
----
$ java -jar $JETTY_HOME/start.jar --add-module=conscrypt
$ java -jar $JETTY_HOME/start.jar --add-modules=conscrypt
----
[[og-protocols-ssl-sni]]

View File

@ -35,7 +35,7 @@ Enable the `quickstart` module for your jetty base:
----
$ cd $JETTY-BASE
$ java -jar $JETTY_HOME/start.jar --add-module=quickstart
$ java -jar $JETTY_HOME/start.jar --add-modules=quickstart
----
The `$JETTY-BASE/start.d/quickstart.ini` file contains these configurable parameters:

View File

@ -45,7 +45,7 @@ $ java -jar $JETTY_HOME/start.jar --add-modules=http
[source,subs=quotes,options=nowrap]
----
include::jetty[args="--add-module=http",highlight="(logging-jetty *transitively enabled|copy.*\.properties)"]
include::jetty[args="--add-modules=http",highlight="(logging-jetty *transitively enabled|copy.*\.properties)"]
----
You can specify the following configuration options in `jetty-logging.properties`:

View File

@ -30,6 +30,8 @@ The `--jpms` option implies the `--exec` option.
When running on the module-path using the `--jpms` option, the Jetty start mechanism will fork a second JVM passing it the right JVM options to run on the module-path.
Therefore, you will have two JVMs running: one that runs `start.jar` and one that runs Jetty on the module-path.
Forking a second JVM may be avoided as explained in xref:og-start-configure-dry-run[this section].
====
When Jetty is started in JPMS mode, all JPMS modules in the module-path are added to the set of JPMS _root modules_ through the JVM option `--add-modules ALL_MODULE_PATH`.

View File

@ -98,10 +98,10 @@ The Jetty start mechanism eventually invokes, by default, main class `org.eclips
The Jetty XML files are nothing more than Java code in XML format.
The XML files are processed to instantiate Jetty components such as `org.eclipse.jetty.server.Server` or `org.eclipse.jetty.util.ssl.SslContextFactory`.
The XML files are processed to instantiate Jetty components such as `org.eclipse.jetty.server.Server` or `org.eclipse.jetty.util.ssl.SslContextFactory$Server`.
The components are then assembled together to provide the configured Jetty features.
The Jetty XML files are parametrized using properties; a property is just a name/value pair.
The Jetty XML files are parametrized using properties, and a property is just a name/value pair.
This parametrization of the XML files allows an XML file that resides in `$JETTY_HOME/etc/` to _declare_ a property such as `jetty.http.port`, and allow this property to be set in a `$JETTY_BASE/start.d/http.ini` file, so that you don't need to change the XML files in `$JETTY_HOME`, but only change files in your `$JETTY_BASE`.