All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.jetty.start.usage.txt Maven / Gradle / Ivy

Usage: java -jar start.jar [options...] [properties...] [configs...]

  The start.jar builds a classpath and executes a main java class with
  a classloader built from that classpath.  By default the start.jar
  mechanism is configured to start the jetty server, but it can be
  configured to start any java main class.

Command Line Options:
---------------------

  --help           This help / usage information.

  --version        Print the version information for Jetty and
                   dependent jars, then exit.

  --list-classpath Print the classpath information that will be used to start
                   Jetty

  --list-config    List the resolved configuration that will be used to
                   start Jetty.
                   Output includes:
                     o  Java Environment
                     o  Jetty Environment
                     o  JVM Arguments
                     o  Properties
                     o  Server Classpath
                     o  Server XML Configuration

  --dry-run        Print the command line that the start.jar generates,
                   then exit. This may be used to generate command lines
                   when the start.ini includes -X or -D arguments:

                     java -jar start.jar --dry-run > jetty.sh
                     . jetty.sh

  --dry-run=parts  Print specific parts of the command line. The parts
                   are a comma separated list of
                     o  "java" - the JVM to run
                     o  "opts" - the JVM options (eg -D and -X flags)
                     o  "path" - the JVM class path or JPMS modules options
                     o  "main" - the main class to run
                     o  "args" - the arguments passed to the main class

                   It is possible to decompose the start command:

                     OPTS=$(java -jar start.jar --dry-run=opts,path)
                     MAIN=$(java -jar start.jar --dry-run=main)
                     ARGS=$(java -jar start.jar --dry-run=args)
                     java $OPTS -Dextra=opt $MAIN $ARGS extra=arg

                   Alternatively to create an args file for java:

                     java -jar start.jar --dry-run=opts,path,main,args > /tmp/args
                     java @/tmp/args

  --exec           Run the generated command line (see --dry-run) in
                   a sub process. This can be used when start.ini
                   contains -X or -D arguments, but creates an extra
                   JVM instance.
                   
  --exec-properties=
                   Assign a fixed name to the file used to transfer 
                   properties to the sub process. This allows the 
                   generated properties file to be saved and reused.
                   Without this option, a temporary file is used.
                   
  --commands=
                   Use each line of the file as arguments on the command
                   line.

Debug and Start Logging:
------------------------

  --debug          Enable debug output of the startup procedure.
                   Note: this does not setup debug for Jetty itself.
                   If you want debug for Jetty, configure your logging.
                   https://www.eclipse.org/jetty/documentation/

  --start-log-file=
                   A filename, relative to ${jetty.base}, where all startup
                   output will be sent.  This is useful for capturing startup
                   issues where the jetty specific logger has not yet kicked
                   in due to startup configuration errors.

Module Management:
------------------

  --list-modules   List non verbose modules defined by the system.
                   Looking for module files in ${jetty.base}/modules/*.mod and
                   then ${jetty.home}/modules/*.mod
                   Will also list enabled state based on information
                   present on ..
                    o  The command line
                    o  The ${jetty.base}/start.ini
                    o  The ${jetty.base}/start.d/*.ini files
  
  --list-modules=(,)*
                   List modules by tag. Use '*' for all tags. Prefix a tag 
                   with '-' to exclude the tag.  The special tag "internal"
                   is always excluded unless it is explicitly included.
                   
  --list-all-modules
                   List all modules.

  --module=(,)*
                   Temporarily enable a module from the command line.
                   Note: this can also be used in the ${jetty.base}/start.ini
                   or ${jetty.base}/start.d/*.ini files.
                   
  --add-to-start=(,)*
                   Add the modules to the list of modules enabled at start. 
                   Transitive dependencies are followed and dependent
                   modules may also explicitly added.
                   Modules are added to the start by creating an ini file
                   that contains the --module argument and any other parameters
                   defined in the modules ini template.                    
                   If the directory ${jetty.base}/start.d 
                   exists then .ini files are created within
                   that directory, otherwise then enabling configuration
                   is appended to the ${jetty.base}/start.ini file.
                   If the ini template contains properties, these may be 
                   amended in the generated file by specifying those 
                   properties on the command line.

                   Note: not all modules have ini templates and thus may
                   be transitively enabled and not explicitly enabled in
                   a ini file.
                   
  --update-ini     Scan all start.ini and start.d/*.ini files and update
                   any properties with values specified on the command
                   line. e.g. --update-ini jetty.http.port=8888

  --create-startd  Ensure that a start.d directory exists for use by
                   subsequent --add-to-start=*. If a start.ini file exists
                   it is moved to the start.d directory

  --write-module-graph=
                   Create a graphviz *.dot file of the module graph as it
                   exists for the active ${jetty.base}.
                   See http://graphviz.org/ for details on how to post-process
                   this file into the output best suited for your needs.
                   
  --create-files   Create any missing files that are required by initialized 
                   modules.  This may download a file from the network if the 
                   module provides a URL.

  --skip-file-validation=(,
                   property set and the stop command must have the same property.

Advanced Commands:
------------------

  --lib=
                   Add arbitrary classpath entries to the the server classpath.
                   
  --include-jetty-dir=
                   Include an extra jetty directory to use as a source
                   for configuration details.  This directory behaves similarly
                   to ${jetty.base} but sits at a layer between ${jetty.base}
                   and ${jetty.home}.  This allows for some complex hierarchies
                   of configuration details.

  --download=|
                   Advanced usage, If the file does not exist at the given
                   location, download it from the given http URI.
                   Notes: location is always relative to ${jetty.base}.
                          you might need to escape the pipe "\|" to use
                          this on some environments.
  maven.repo.uri=[url]
                  The url to use to download Maven dependencies.
                  Default is https://repo1.maven.org/maven2/.



Properties:
-----------
  Properties are used to parameterize:
    + XML files using the  element 
    + Module files using the ${pname} syntax

  Properties and System Properties may be set on the command line, 
  in a ini file or in a [ini] section of a module using the following syntax:

    name=value
      Set a property that can be expanded in XML files with the  element.

    name+=value
      Append value to an existing property value.
      
    name+=,value
      Append value to an existing property value, using a comma separator if needed.

    name?=value
      Set a property only if it is not already set.

  If any of the previous formats is preceded by -D, then a system property is set 
  as well as a start property.
   
  Each module may define it's own properties. Start properties defined include:

    jetty.home=[directory]
      Set the home directory of the jetty distribution.

    jetty.base=[directory]
      Set the jetty configuration directory.  This is where the etc, webapps and start
      files will be looked for. If not found in jetty.base, they are looked for in
      jetty.home.

    STOP.HOST=[string]
      The host to use to stop the running Jetty server (defaults to 127.0.0.1)
      Required along with STOP.PORT if you want to use the --stop option above.
      
    STOP.PORT=[number]
      The port to use to stop the running Jetty server.
      Required along with STOP.KEY if you want to use the --stop option above.

    STOP.KEY=[alphanumeric]
      The passphrase defined to stop the server.
      Required along with STOP.PORT if you want to use the --stop option above.

    STOP.WAIT=[number]
      The time (in seconds) to wait for confirmation that the running
      Jetty server has stopped. If not specified, the stopper will wait
      indefinitely. Use in conjunction with the --stop option.

    maven.repo.uri=[url] default https://repo1.maven.org/maven2/.
      The url to use to download Maven dependencies.


Defaults:
---------

  Command line arguments can come from any jetty configuration directory
  (except ${jetty.home}), such as ${jetty.base} and any added jetty directories
  (see --include-jetty-dir=).  
  The contents of /start.ini and /start.d/*.ini are all used
  to build up your command line arguments.
  In case of a conflict, the resolution of who wins, will look like this.
    
    1) 
    2) ${jetty.base}/start.ini
    3) ${jetty.base}/start.d/*.ini
    4) /start.ini
    5) /start.d/*.ini

For more information on startup, see the online documentation at
    https://www.eclipse.org/jetty/documentation/




© 2015 - 2025 Weber Informatics LLC | Privacy Policy