diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod index c98eaf22514..43d1ea6e7b2 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod @@ -1,6 +1,10 @@ [description] Enables GCloud Datastore API and implementation +[Tags] +3rdparty +gcloud + [depends] gcloud jcl-api diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud.mod index 7c774c795d0..1508e7e98d3 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud.mod @@ -1,6 +1,10 @@ [description] Control GCloud API classpath +[Tags] +3rdparty +gcloud + [files] basehome:modules/gcloud/gcloud.xml|etc/gcloud.xml diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/session-store-gcloud.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/session-store-gcloud.mod index 3d6b26e0497..c5e933032fa 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/session-store-gcloud.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/session-store-gcloud.mod @@ -1,6 +1,10 @@ [description] Enables GCloudDatastore session management. +[Tags] +session +gcloud + [provides] session-store diff --git a/jetty-home/src/main/resources/modules/hawtio.mod b/jetty-home/src/main/resources/modules/hawtio.mod index fcc34d15048..c8eeb0d888d 100644 --- a/jetty-home/src/main/resources/modules/hawtio.mod +++ b/jetty-home/src/main/resources/modules/hawtio.mod @@ -1,6 +1,9 @@ [description] Deploys the Hawtio console as a webapplication. +[Tags] +3rdparty + [depend] stats deploy diff --git a/jetty-home/src/main/resources/modules/jamon.mod b/jetty-home/src/main/resources/modules/jamon.mod index 96a331c65ad..72c76f055ff 100644 --- a/jetty-home/src/main/resources/modules/jamon.mod +++ b/jetty-home/src/main/resources/modules/jamon.mod @@ -1,6 +1,9 @@ [description] Deploys the JAMon webapplication +[Tags] +3rdparty + [depend] stats deploy diff --git a/jetty-home/src/main/resources/modules/jminix.mod b/jetty-home/src/main/resources/modules/jminix.mod index 4bd48c9e72d..fc8328921f5 100644 --- a/jetty-home/src/main/resources/modules/jminix.mod +++ b/jetty-home/src/main/resources/modules/jminix.mod @@ -1,6 +1,9 @@ [description] Deploys the Jminix JMX Console within the server +[Tags] +3rdparty + [depend] stats jmx diff --git a/jetty-home/src/main/resources/modules/jolokia.mod b/jetty-home/src/main/resources/modules/jolokia.mod index efe8a59185e..5020a2fd83b 100644 --- a/jetty-home/src/main/resources/modules/jolokia.mod +++ b/jetty-home/src/main/resources/modules/jolokia.mod @@ -1,6 +1,9 @@ [description] Deploys the Jolokia console as a web application. +[Tags] +3rdparty + [depend] stats deploy diff --git a/jetty-http2/http2-server/src/main/config/modules/http2.mod b/jetty-http2/http2-server/src/main/config/modules/http2.mod index 88baddb13ab..5927f571279 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2.mod @@ -2,6 +2,12 @@ Enables HTTP2 protocol support on the TLS(SSL) Connector, using the ALPN extension to select which protocol to use. +[Tags] +connector +http2 +http +ssl + [depend] ssl alpn diff --git a/jetty-http2/http2-server/src/main/config/modules/http2c.mod b/jetty-http2/http2-server/src/main/config/modules/http2c.mod index 80b2a28a335..b0fee130af5 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2c.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2c.mod @@ -2,6 +2,11 @@ Enables the HTTP2C protocol on the HTTP Connector The connector will accept both HTTP/1 and HTTP/2 connections. +[Tags] +connector +http2 +http + [depend] http diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod index 76441062683..bd0bb80ea10 100644 --- a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod @@ -1,6 +1,9 @@ [description] Enables session data store in a local Infinispan cache +[Tags] +session + [provides] session-store diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote.mod index f9c398a5b1e..70c62076d94 100644 --- a/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote.mod +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote.mod @@ -1,6 +1,9 @@ [description] Enables session data store in a remote Infinispan cache +[Tags] +session + [provides] session-store diff --git a/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod b/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod index 76987983ddc..48c589ae00c 100644 --- a/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod +++ b/jetty-memcached/jetty-memcached-sessions/src/main/config/modules/sessions/session-data-cache/xmemcached.mod @@ -1,6 +1,9 @@ [description] Memcache cache for SessionData +[Tags] +session + [depends] session-store slf4j-api diff --git a/jetty-nosql/src/main/config/modules/session-store-mongo.mod b/jetty-nosql/src/main/config/modules/session-store-mongo.mod index 77723093f6d..c1ffb5c755e 100644 --- a/jetty-nosql/src/main/config/modules/session-store-mongo.mod +++ b/jetty-nosql/src/main/config/modules/session-store-mongo.mod @@ -1,6 +1,9 @@ [description] Enables NoSql session management with a MongoDB driver. +[Tags] +session + [provides] session-store diff --git a/jetty-server/src/main/config/modules/debug.mod b/jetty-server/src/main/config/modules/debug.mod index 7b75ecc0e79..9e0ae040b9f 100644 --- a/jetty-server/src/main/config/modules/debug.mod +++ b/jetty-server/src/main/config/modules/debug.mod @@ -3,6 +3,9 @@ Enables the DebugListener to generate additional logging regarding detailed request handling events. Renames threads to include request URI. +[Tags] +debug + [depend] deploy diff --git a/jetty-server/src/main/config/modules/debuglog.mod b/jetty-server/src/main/config/modules/debuglog.mod index a76f728a5b4..81db4894c71 100644 --- a/jetty-server/src/main/config/modules/debuglog.mod +++ b/jetty-server/src/main/config/modules/debuglog.mod @@ -2,6 +2,9 @@ Deprecated Debug Log using the DebugHandle. Replaced with the debug module. +[Tags] +debug + [depend] server diff --git a/jetty-server/src/main/config/modules/ext.mod b/jetty-server/src/main/config/modules/ext.mod index 4171f8dfc21..63081e550dd 100644 --- a/jetty-server/src/main/config/modules/ext.mod +++ b/jetty-server/src/main/config/modules/ext.mod @@ -2,6 +2,9 @@ Adds all jar files discovered in $JETTY_HOME/lib/ext and $JETTY_BASE/lib/ext to the servers classpath. +[Tags] +classpath + [lib] lib/ext/**.jar diff --git a/jetty-server/src/main/config/modules/gzip.mod b/jetty-server/src/main/config/modules/gzip.mod index d0173efa60f..50db40b156e 100644 --- a/jetty-server/src/main/config/modules/gzip.mod +++ b/jetty-server/src/main/config/modules/gzip.mod @@ -2,6 +2,9 @@ Enable GzipHandler for dynamic gzip compression for the entire server. +[Tags] +handler + [depend] server diff --git a/jetty-server/src/main/config/modules/http-forwarded.mod b/jetty-server/src/main/config/modules/http-forwarded.mod index 6508a2b9a3f..2797bc29d3b 100644 --- a/jetty-server/src/main/config/modules/http-forwarded.mod +++ b/jetty-server/src/main/config/modules/http-forwarded.mod @@ -2,6 +2,9 @@ Adds a forwarded request customizer to the HTTP Connector to process forwarded-for style headers from a proxy. +[Tags] +connector + [depend] http diff --git a/jetty-server/src/main/config/modules/http.mod b/jetty-server/src/main/config/modules/http.mod index 3f2766f0e45..caf104cb9b4 100644 --- a/jetty-server/src/main/config/modules/http.mod +++ b/jetty-server/src/main/config/modules/http.mod @@ -3,6 +3,10 @@ Enables a HTTP connector on the server. By default HTTP/1 is support, but HTTP2C can be added to the connector with the http2c module. +[Tags] +connector +http + [depend] server diff --git a/jetty-server/src/main/config/modules/https.mod b/jetty-server/src/main/config/modules/https.mod index 6ffbd69d0cc..9ff301e58d5 100644 --- a/jetty-server/src/main/config/modules/https.mod +++ b/jetty-server/src/main/config/modules/https.mod @@ -1,6 +1,12 @@ [description] Adds HTTPS protocol support to the TLS(SSL) Connector +[Tags] +connector +https +http +ssl + [depend] ssl diff --git a/jetty-server/src/main/config/modules/ipaccess.mod b/jetty-server/src/main/config/modules/ipaccess.mod index 68f04dfc576..5afd05e0a11 100644 --- a/jetty-server/src/main/config/modules/ipaccess.mod +++ b/jetty-server/src/main/config/modules/ipaccess.mod @@ -2,6 +2,9 @@ Enable the ipaccess handler to apply a white/black list control of the remote IP of requests. +[Tags] +handler + [depend] server diff --git a/jetty-server/src/main/config/modules/jvm.mod b/jetty-server/src/main/config/modules/jvm.mod index 173a6d11ba1..b6793e3b03b 100644 --- a/jetty-server/src/main/config/modules/jvm.mod +++ b/jetty-server/src/main/config/modules/jvm.mod @@ -1,6 +1,7 @@ [description] A noop module that creates an ini template useful for setting JVM arguments (eg -Xmx ) + [ini-template] ## JVM Configuration ## If JVM args are include in an ini file then --exec is needed diff --git a/jetty-server/src/main/config/modules/logback-access.mod b/jetty-server/src/main/config/modules/logback-access.mod index b1275ba49b9..0cb8bd0de45 100644 --- a/jetty-server/src/main/config/modules/logback-access.mod +++ b/jetty-server/src/main/config/modules/logback-access.mod @@ -1,6 +1,11 @@ [description] Enables logback request log. +[Tags] +requestlog +logging +logback + [depend] server logback-core diff --git a/jetty-server/src/main/config/modules/proxy-protocol-ssl.mod b/jetty-server/src/main/config/modules/proxy-protocol-ssl.mod index 374763d0b5b..4b41e935bb6 100644 --- a/jetty-server/src/main/config/modules/proxy-protocol-ssl.mod +++ b/jetty-server/src/main/config/modules/proxy-protocol-ssl.mod @@ -5,6 +5,10 @@ This allows a Proxy operating in TCP mode to transport details of the proxied connection to the server. Both V1 and V2 versions of the protocol are supported. +[Tags] +connector +ssl + [depend] ssl diff --git a/jetty-server/src/main/config/modules/requestlog.mod b/jetty-server/src/main/config/modules/requestlog.mod index 628f759e088..0bf60edcdc0 100644 --- a/jetty-server/src/main/config/modules/requestlog.mod +++ b/jetty-server/src/main/config/modules/requestlog.mod @@ -1,6 +1,9 @@ [description] Enables a NCSA style request log. +[Tags] +requestlog + [depend] server @@ -36,4 +39,4 @@ logs/ # jetty.requestlog.timezone=GMT ## Whether to log LogLatency -# jetty.requestlog.loglatency=false \ No newline at end of file +# jetty.requestlog.loglatency=false diff --git a/jetty-server/src/main/config/modules/resources.mod b/jetty-server/src/main/config/modules/resources.mod index 56489486408..4e0bd35b43a 100644 --- a/jetty-server/src/main/config/modules/resources.mod +++ b/jetty-server/src/main/config/modules/resources.mod @@ -3,6 +3,9 @@ Adds the $JETTY_HOME/resources and/or $JETTY_BASE/resources directory to the server classpath. Useful for configuration property files (eg jetty-logging.properties) +[Tags] +classpath + [lib] resources/ diff --git a/jetty-server/src/main/config/modules/session-cache-hash.mod b/jetty-server/src/main/config/modules/session-cache-hash.mod index 9a09ec5dbdb..1f257867b25 100644 --- a/jetty-server/src/main/config/modules/session-cache-hash.mod +++ b/jetty-server/src/main/config/modules/session-cache-hash.mod @@ -4,6 +4,9 @@ If not enabled, sessions will use a HashSessionCache by default, so enabling via this module is only needed if the configuration properties need to be changed. +[Tags] +session + [provides] session-cache diff --git a/jetty-server/src/main/config/modules/session-cache-null.mod b/jetty-server/src/main/config/modules/session-cache-null.mod index 81e5b02b9e4..70c9e97fa37 100644 --- a/jetty-server/src/main/config/modules/session-cache-null.mod +++ b/jetty-server/src/main/config/modules/session-cache-null.mod @@ -1,6 +1,9 @@ [description] A trivial SessionCache that does not actually cache sessions. +[Tags] +session + [provides] session-cache diff --git a/jetty-server/src/main/config/modules/session-store-cache.mod b/jetty-server/src/main/config/modules/session-store-cache.mod index e9a170b823e..cac19d1207d 100644 --- a/jetty-server/src/main/config/modules/session-store-cache.mod +++ b/jetty-server/src/main/config/modules/session-store-cache.mod @@ -1,6 +1,9 @@ [description] Enables caching of SessionData in front of a SessionDataStore. +[Tags] +session + [depend] session-store diff --git a/jetty-server/src/main/config/modules/session-store-file.mod b/jetty-server/src/main/config/modules/session-store-file.mod index 22726641879..d644f67dddd 100644 --- a/jetty-server/src/main/config/modules/session-store-file.mod +++ b/jetty-server/src/main/config/modules/session-store-file.mod @@ -1,6 +1,9 @@ [description] Enables session persistent storage in files. +[Tags] +session + [provides] session-store diff --git a/jetty-server/src/main/config/modules/session-store-jdbc.mod b/jetty-server/src/main/config/modules/session-store-jdbc.mod index a3f41956b24..69bf3125bd0 100644 --- a/jetty-server/src/main/config/modules/session-store-jdbc.mod +++ b/jetty-server/src/main/config/modules/session-store-jdbc.mod @@ -1,6 +1,9 @@ [description] Enables JDBC peristent/distributed session storage. +[Tags] +session + [provides] session-store diff --git a/jetty-server/src/main/config/modules/sessions.mod b/jetty-server/src/main/config/modules/sessions.mod index e90cd8aa2bd..4ce1cde856e 100644 --- a/jetty-server/src/main/config/modules/sessions.mod +++ b/jetty-server/src/main/config/modules/sessions.mod @@ -5,6 +5,9 @@ created or by enabling other session-cache or session-store modules. Without this module enabled, the server may still use sessions, but their management cannot be configured. +[Tags] +session + [depends] server diff --git a/jetty-server/src/main/config/modules/ssl.mod b/jetty-server/src/main/config/modules/ssl.mod index 43c29143bde..db92f255bb2 100644 --- a/jetty-server/src/main/config/modules/ssl.mod +++ b/jetty-server/src/main/config/modules/ssl.mod @@ -3,6 +3,10 @@ Enables a TLS(SSL) Connector on the server. This may be used for HTTPS and/or HTTP2 by enabling the associated support modules. +[Tags] +connector +ssl + [depend] server diff --git a/jetty-server/src/main/config/modules/stats.mod b/jetty-server/src/main/config/modules/stats.mod index 838d54a904d..2b4d3d32f8b 100644 --- a/jetty-server/src/main/config/modules/stats.mod +++ b/jetty-server/src/main/config/modules/stats.mod @@ -2,6 +2,9 @@ Enable detailed statistics collection for the server, available via JMX. +[Tags] +handler + [depend] server diff --git a/jetty-server/src/main/config/modules/threadlimit.mod b/jetty-server/src/main/config/modules/threadlimit.mod index 1a2615bd9b9..b6d41dc1480 100644 --- a/jetty-server/src/main/config/modules/threadlimit.mod +++ b/jetty-server/src/main/config/modules/threadlimit.mod @@ -3,6 +3,9 @@ # Applies ThreadLimiteHandler to entire server # +[Tags] +handler + [depend] server diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java index 3463ad3ecfe..39c7bbabfa4 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java @@ -243,16 +243,19 @@ public class Main public void listModules(StartArgs args) { + List tags = args.getListModules(); + StartLog.endStartLog(); System.out.println(); - System.out.println("Jetty All Available Modules:"); - System.out.println("----------------------------"); - args.getAllModules().dump(); + System.out.println("Available Modules:"); + System.out.println("=================="); + System.out.println("tags: "+tags); + args.getAllModules().dump(tags); // Dump Enabled Modules System.out.println(); - System.out.println("Jetty Selected Module Ordering:"); - System.out.println("-------------------------------"); + System.out.println("Enabled Modules:"); + System.out.println("================"); Modules modules = args.getAllModules(); modules.dumpEnabled(); } @@ -381,7 +384,7 @@ public class Main } // Show modules - if (args.isListModules()) + if (args.getListModules()!=null) { listModules(args); } diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java index 7f31cf3390f..e318cc127a9 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Module.java @@ -55,7 +55,7 @@ import java.util.stream.Collectors; * A module may be enabled, either directly by name or transiently via a dependency * from another module by name or provided capability. */ -public class Module +public class Module implements Comparable { private static final String VERSION_UNSPECIFIED = "9.2"; private static Pattern MOD_NAME = Pattern.compile("^(.*)\\.mod",Pattern.CASE_INSENSITIVE); @@ -96,6 +96,9 @@ public class Module /** List of provides for this Module */ private final Set _provides=new HashSet<>(); + /** List of tags for this Module */ + private final List _tags=new ArrayList<>(); + /** Boolean true if directly enabled, false if all selections are transitive */ private boolean _notTransitive; @@ -328,6 +331,10 @@ public class Module case "FILES": _files.add(line); break; + case "TAG": + case "TAGS": + _tags.add(line); + break; case "DEFAULTS": // old name introduced in 9.2.x case "INI": // new name for 9.3+ _defaultConfig.add(line); @@ -446,6 +453,16 @@ public class Module return _description; } + public List getTags() + { + return _tags; + } + + public String getPrimaryTag() + { + return _tags.isEmpty()?"*":_tags.get(0); + } + public boolean isEnabled() { return !_enables.isEmpty(); @@ -504,4 +521,13 @@ public class Module out.println(); out.flush(); } + + @Override + public int compareTo(Module m) + { + int by_tag = getPrimaryTag().compareTo(m.getPrimaryTag()); + if (by_tag!=0) + return by_tag; + return getName().compareTo(m.getName()); + } } diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java index 3fee8802054..91f8a15f462 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -30,10 +31,13 @@ import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.hamcrest.core.StringStartsWith; + /** * Access for all modules declared, as well as what is enabled. */ @@ -57,59 +61,92 @@ public class Modules implements Iterable } } - public void dump() + public void dump(List tags) { - List ordered = _modules.stream().map(m->{return m.getName();}).collect(Collectors.toList()); - Collections.sort(ordered); - ordered.stream().map(n->{return get(n);}).forEach(module-> - { - String status = "[ ]"; - if (module.isTransitive()) + Set exclude = tags.stream().filter(t->t.startsWith("-")).map(t->t.substring(1)).collect(Collectors.toSet()); + Set include = tags.stream().filter(t->!t.startsWith("-")).collect(Collectors.toSet()); + boolean all = include.contains("*") || include.isEmpty(); + AtomicReference tag = new AtomicReference<>(); + + _modules.stream() + .filter(m-> { - status = "[t]"; - } - else if (module.isEnabled()) + boolean included = all || m.getTags().stream().anyMatch(t->include.contains(t)); + boolean excluded = m.getTags().stream().anyMatch(t->exclude.contains(t)); + return included && !excluded; + }) + .sorted() + .forEach(module-> { - status = "[x]"; - } - - System.out.printf("%n %s Module: %s%n",status,module.getName()); - if (module.getProvides().size()>1) - { - System.out.printf(" Provides: %s%n",module.getProvides()); - } - for (String description : module.getDescription()) - { - System.out.printf(" : %s%n",description); - } - for (String parent : module.getDepends()) - { - System.out.printf(" Depend: %s%n",parent); - } - for (String optional : module.getOptional()) - { - System.out.printf(" Optional: %s%n",optional); - } - for (String lib : module.getLibs()) - { - System.out.printf(" LIB: %s%n",lib); - } - for (String xml : module.getXmls()) - { - System.out.printf(" XML: %s%n",xml); - } - for (String jvm : module.getJvmArgs()) - { - System.out.printf(" JVM: %s%n",jvm); - } - if (module.isEnabled()) - { - for (String selection : module.getEnableSources()) + if (!module.getPrimaryTag().equals(tag.get())) { - System.out.printf(" Enabled: %s%n",selection); + tag.set(module.getPrimaryTag()); + System.out.printf("%nModules for tag '%s':%n",module.getPrimaryTag()); + System.out.print("-------------------"); + for (int i=module.getPrimaryTag().length();i-->0;) + System.out.print("-"); + System.out.println(); + } - } - }); + + String label; + Set provides = module.getProvides(); + provides.remove(module.getName()); + System.out.printf("%n Module: %s %s%n",module.getName(),provides.size()>0?provides:""); + for (String description : module.getDescription()) + { + System.out.printf(" : %s%n",description); + } + if (!module.getTags().isEmpty()) + { + label=" Tags: %s"; + for (String t : module.getTags()) + { + System.out.printf(label,t); + label=", %s"; + } + System.out.println(); + } + if (!module.getDepends().isEmpty()) + { + label=" Depend: %s"; + for (String parent : module.getDepends()) + { + System.out.printf(label,parent); + label=", %s"; + } + System.out.println(); + } + if (!module.getOptional().isEmpty()) + { + label=" Optional: %s"; + for (String parent : module.getOptional()) + { + System.out.printf(label,parent); + label=", %s"; + } + System.out.println(); + } + for (String lib : module.getLibs()) + { + System.out.printf(" LIB: %s%n",lib); + } + for (String xml : module.getXmls()) + { + System.out.printf(" XML: %s%n",xml); + } + for (String jvm : module.getJvmArgs()) + { + System.out.printf(" JVM: %s%n",jvm); + } + if (module.isEnabled()) + { + for (String selection : module.getEnableSources()) + { + System.out.printf(" Enabled: %s%n",selection); + } + } + }); } public void dumpEnabled() diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java index 5b5bc8f5fc8..5a3e94ad119 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java @@ -170,7 +170,7 @@ public class StartArgs private boolean help = false; private boolean stopCommand = false; - private boolean listModules = false; + private List listModules = null; private boolean listClasspath = false; private boolean listConfig = false; private boolean version = false; @@ -750,7 +750,7 @@ public class StartArgs return listConfig; } - public boolean isListModules() + public List getListModules() { return listModules; } @@ -873,7 +873,7 @@ public class StartArgs if (arg.equals("--create-files")) { run = false; - download = true; + download = true;boolean licenseCheckRequired = true; return; } @@ -938,10 +938,25 @@ public class StartArgs return; } + // Module Management + if ("--list-all-modules".equals(arg)) + { + listModules = Collections.singletonList("*"); + run = false; + return; + } + // Module Management if ("--list-modules".equals(arg)) { - listModules = true; + listModules = Collections.singletonList("-verbose"); + run = false; + return; + } + + if (arg.startsWith("--list-modules=")) + { + listModules = Props.getValues(arg); run = false; return; } diff --git a/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt b/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt index 27f76f44016..fad5157f0ae 100644 --- a/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt +++ b/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt @@ -59,7 +59,7 @@ Debug and Start Logging: Module Management: ------------------ - --list-modules List all modules defined by the system. + --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 @@ -67,6 +67,13 @@ Module Management: 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. + + --list-all-modules + List all modules. --module=(,)* Temporarily enable a module from the command line. diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod index 80d19995880..cb14381ebae 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod @@ -4,6 +4,9 @@ by the Unix Domain Socket connector, for use when behind a proxy operating in HTTP mode that adds forwarded-for style HTTP headers. Typically this is an alternate to the Proxy Protocol used mostly for TCP mode. +[Tags] +connector + [depend] unixsocket-http diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod index 05c46bee795..1605722f685 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod @@ -4,6 +4,10 @@ It should be used when a proxy is forwarding either HTTP or decrypted HTTPS traffic to the connector and may be used with the unix-socket-http2c modules to upgrade to HTTP/2. +[Tags] +connector +http + [depend] unixsocket diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod index 59f844977be..6e112221cfe 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod @@ -3,6 +3,10 @@ Adds a HTTP2C connetion factory to the Unix Domain Socket Connector It can be used when either the proxy forwards direct HTTP/2C (unecrypted) or decrypted HTTP/2 traffic. +[Tags] +connector +http2 + [depend] unixsocket-http diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod index 11184d39471..cfa3c726fb7 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod @@ -8,6 +8,9 @@ SSL properties may be interpreted by the unixsocket-secure module to indicate secure HTTPS traffic. Typically this is an alternate to the forwarded module. +[Tags] +connector + [depend] unixsocket diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod b/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod index 43344706038..8d099b539fa 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod @@ -5,6 +5,9 @@ This looks for a secure scheme transported either by the unixsocket-forwarded, unixsocket-proxy-protocol or in a HTTP2 request. +[Tags] +connector + [depend] unixsocket-http diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket.mod b/jetty-unixsocket/src/main/config/modules/unixsocket.mod index c27ec9d2f43..f4defea923c 100644 --- a/jetty-unixsocket/src/main/config/modules/unixsocket.mod +++ b/jetty-unixsocket/src/main/config/modules/unixsocket.mod @@ -7,6 +7,9 @@ needless fragmentation and have better dispatch behaviours. When enabled with corresponding support modules, the connector can accept HTTP, HTTPS or HTTP2C traffic. +[Tags] +connector + [depend] server diff --git a/jetty-util/src/main/config/modules/jcl-slf4j.mod b/jetty-util/src/main/config/modules/jcl-slf4j.mod index bc5ebfbbf03..11cbff366bf 100644 --- a/jetty-util/src/main/config/modules/jcl-slf4j.mod +++ b/jetty-util/src/main/config/modules/jcl-slf4j.mod @@ -2,6 +2,11 @@ Provides a Java Commons Logging implementation that logs to the SLF4J API. Requires another module that provides and SLF4J implementation. +[tags] +logging +jcl +slf4j + [depends] slf4j-api diff --git a/jetty-util/src/main/config/modules/jcl.mod b/jetty-util/src/main/config/modules/jcl.mod index c72533a6c40..6118dcadc99 100644 --- a/jetty-util/src/main/config/modules/jcl.mod +++ b/jetty-util/src/main/config/modules/jcl.mod @@ -2,6 +2,10 @@ Provides a Java Commons Logging implementation. To receive jetty logs the jetty-slf4j and slf4j-jcl must also be enabled. +[tags] +logging +jcl + [depends] [provides] diff --git a/jetty-util/src/main/config/modules/jetty-jul.mod b/jetty-util/src/main/config/modules/jetty-jul.mod index ed7340af74c..78b91462799 100644 --- a/jetty-util/src/main/config/modules/jetty-jul.mod +++ b/jetty-util/src/main/config/modules/jetty-jul.mod @@ -2,6 +2,9 @@ Provides a Jetty Logging implementation that logs to the Java Util Logging API. Requires another module that provides a Java Util Logging implementation. +[tags] +logging + [provide] logging diff --git a/jetty-util/src/main/config/modules/jetty-log4j.mod b/jetty-util/src/main/config/modules/jetty-log4j.mod index 7717400b784..7b22d0e39ca 100644 --- a/jetty-util/src/main/config/modules/jetty-log4j.mod +++ b/jetty-util/src/main/config/modules/jetty-log4j.mod @@ -3,6 +3,10 @@ Provides a Jetty Logging implementation that logs to the log4j API. Uses the slf4j mechanism as an intermediary Requires another module that provides an log4j implementation. +[tags] +logging +log4j + [depend] jetty-slf4j slf4j-log4j diff --git a/jetty-util/src/main/config/modules/jetty-log4j2.mod b/jetty-util/src/main/config/modules/jetty-log4j2.mod index c77ca46b8ba..045d639adc3 100644 --- a/jetty-util/src/main/config/modules/jetty-log4j2.mod +++ b/jetty-util/src/main/config/modules/jetty-log4j2.mod @@ -3,6 +3,11 @@ Provides a Jetty Logging implementation that logs to the log4j API. Uses the slf4j and log4j v1.2 mechanisms as intermediaries. Requires another module that provides an log4j2 implementation. +[tags] +logging +log4j2 +log4j + [depend] jetty-slf4j slf4j-log4j2 diff --git a/jetty-util/src/main/config/modules/jetty-logback.mod b/jetty-util/src/main/config/modules/jetty-logback.mod index e5373fd5301..0d6b1ce57c5 100644 --- a/jetty-util/src/main/config/modules/jetty-logback.mod +++ b/jetty-util/src/main/config/modules/jetty-logback.mod @@ -2,6 +2,9 @@ Provides a Jetty Logging implementation that logs to logback. Uses the slf4j API as an intermediary +[tags] +logging + [depend] jetty-slf4j slf4j-logback diff --git a/jetty-util/src/main/config/modules/jetty-logging.mod b/jetty-util/src/main/config/modules/jetty-logging.mod index 3b46e5954ca..fcb4c749c22 100644 --- a/jetty-util/src/main/config/modules/jetty-logging.mod +++ b/jetty-util/src/main/config/modules/jetty-logging.mod @@ -2,6 +2,9 @@ Enables the Jetty Logging implementation and installs a template configuration in ${jetty.base} resources/jetty-logging.properties. +[tags] +logging + [depends] resources diff --git a/jetty-util/src/main/config/modules/jetty-slf4j.mod b/jetty-util/src/main/config/modules/jetty-slf4j.mod index 3836363748d..b0d68ed509a 100644 --- a/jetty-util/src/main/config/modules/jetty-slf4j.mod +++ b/jetty-util/src/main/config/modules/jetty-slf4j.mod @@ -2,6 +2,10 @@ Provides a Jetty Logging implementation that logs to the SLF4J API. Requires another module that provides and SLF4J implementation. +[tags] +logging +slf4j + [depend] slf4j-api slf4j-impl diff --git a/jetty-util/src/main/config/modules/log4j-log4j2.mod b/jetty-util/src/main/config/modules/log4j-log4j2.mod index 7a055ee07e1..397575ff3ed 100644 --- a/jetty-util/src/main/config/modules/log4j-log4j2.mod +++ b/jetty-util/src/main/config/modules/log4j-log4j2.mod @@ -3,6 +3,11 @@ Provides a Log4j v1.2 implementation that logs to the Log4j v2 API. Requires another module that provides and Log4j v2 implementation. To receive jetty logs the jetty-slf4j and slf4j-log4j must also be enabled. +[tags] +logging +log4j2 +log4j + [depends] log4j2-api log4j2-impl diff --git a/jetty-util/src/main/config/modules/log4j.mod b/jetty-util/src/main/config/modules/log4j.mod index 437a297afaa..d8833924fe0 100644 --- a/jetty-util/src/main/config/modules/log4j.mod +++ b/jetty-util/src/main/config/modules/log4j.mod @@ -2,6 +2,10 @@ Provides a Log4j v1.2 API and implementation. To receive jetty logs enable the jetty-slf4j and slf4j-log4j modules. +[tags] +logging +log4j + [depends] resources diff --git a/jetty-util/src/main/config/modules/log4j2-api.mod b/jetty-util/src/main/config/modules/log4j2-api.mod index 3244acf19f0..3b1ce7dee76 100644 --- a/jetty-util/src/main/config/modules/log4j2-api.mod +++ b/jetty-util/src/main/config/modules/log4j2-api.mod @@ -3,6 +3,12 @@ Provides the Log4j v2 API Requires another module that provides an Log4j v2 implementation. To receive jetty logs enable the jetty-slf4j, slf4j-log4j and log4j-log4j2 modules. +[tags] +logging +log4j2 +log4j +verbose + [files] maven://org.apache.logging.log4j/log4j-api/${log4j2.version}|lib/log4j/log4j-api-${log4j2.version}.jar diff --git a/jetty-util/src/main/config/modules/log4j2-core.mod b/jetty-util/src/main/config/modules/log4j2-core.mod index 9b04f2013ad..27ba3252280 100644 --- a/jetty-util/src/main/config/modules/log4j2-core.mod +++ b/jetty-util/src/main/config/modules/log4j2-core.mod @@ -2,6 +2,11 @@ Provides a Log4j v2 implementation. To receive jetty logs enable the jetty-slf4j, slf4j-log4j and log4j-log4j2 modules. +[tags] +logging +log4j2 +log4j + [depends] log4j2-api resources diff --git a/jetty-util/src/main/config/modules/log4j2-slf4j.mod b/jetty-util/src/main/config/modules/log4j2-slf4j.mod index 6324c0d37d4..baa9c277ac0 100644 --- a/jetty-util/src/main/config/modules/log4j2-slf4j.mod +++ b/jetty-util/src/main/config/modules/log4j2-slf4j.mod @@ -3,6 +3,12 @@ Provides a Log4j v2 implementation that logs to the SLF4J API. Requires another module that provides and SLF4J implementation. To receive jetty logs enable the jetty-slf4j module. +[tags] +logging +log4j2 +log4j +slf4j + [depends] log4j2-api slf4j-api diff --git a/jetty-util/src/main/config/modules/logback-core.mod b/jetty-util/src/main/config/modules/logback-core.mod index fa2832bd52c..9e3c0de8f7e 100644 --- a/jetty-util/src/main/config/modules/logback-core.mod +++ b/jetty-util/src/main/config/modules/logback-core.mod @@ -2,6 +2,9 @@ Provides the logback core implementation, used by slf4j-logback and logback-access +[tags] +logging + [files] maven://ch.qos.logback/logback-core/${logback.version}|lib/logback/logback-core-${logback.version}.jar diff --git a/jetty-util/src/main/config/modules/slf4j-api.mod b/jetty-util/src/main/config/modules/slf4j-api.mod index b4eda7f19f8..a20b67e9b42 100644 --- a/jetty-util/src/main/config/modules/slf4j-api.mod +++ b/jetty-util/src/main/config/modules/slf4j-api.mod @@ -2,6 +2,11 @@ Provides SLF4J API. Requires a slf4j implementation (eg slf4j-simple) otherwise a noop implementation is used. +[tags] +logging +slf4j +verbose + [files] maven://org.slf4j/slf4j-api/${slf4j.version}|lib/slf4j/slf4j-api-${slf4j.version}.jar diff --git a/jetty-util/src/main/config/modules/slf4j-jcl.mod b/jetty-util/src/main/config/modules/slf4j-jcl.mod index 6a9773a048c..a3c1cddc428 100644 --- a/jetty-util/src/main/config/modules/slf4j-jcl.mod +++ b/jetty-util/src/main/config/modules/slf4j-jcl.mod @@ -3,6 +3,11 @@ Provides a SLF4J implementation that logs to the Java Commons Logging API. Requires another module that provides an JCL implementation. To receive jetty logs enable the jetty-slf4j module. +[tags] +logging +jcl +slf4j + [depend] slf4j-api jcl-api diff --git a/jetty-util/src/main/config/modules/slf4j-jul.mod b/jetty-util/src/main/config/modules/slf4j-jul.mod index fc858778d2f..298a033ae55 100644 --- a/jetty-util/src/main/config/modules/slf4j-jul.mod +++ b/jetty-util/src/main/config/modules/slf4j-jul.mod @@ -2,6 +2,10 @@ Provides a SLF4J implementation that logs to the Java Util Logging API. To receive jetty logs enable the jetty-slf4j module. +[tags] +logging +slf4j + [depend] slf4j-api diff --git a/jetty-util/src/main/config/modules/slf4j-log4j.mod b/jetty-util/src/main/config/modules/slf4j-log4j.mod index 75c98577d02..cc494361349 100644 --- a/jetty-util/src/main/config/modules/slf4j-log4j.mod +++ b/jetty-util/src/main/config/modules/slf4j-log4j.mod @@ -3,6 +3,11 @@ Provides a SLF4J implementation that logs to the Log4j v1.2 API. Requires another module that provides a Log4j implementation. To receive jetty logs enable the jetty-slf4j module. +[tags] +logging +log4j +slf4j + [depend] slf4j-api log4j-api diff --git a/jetty-util/src/main/config/modules/slf4j-log4j2.mod b/jetty-util/src/main/config/modules/slf4j-log4j2.mod index 2f9d023059e..930c7bff132 100644 --- a/jetty-util/src/main/config/modules/slf4j-log4j2.mod +++ b/jetty-util/src/main/config/modules/slf4j-log4j2.mod @@ -3,6 +3,12 @@ Provides a SLF4J implementation that logs to the Log4j v2 API. Requires another module that provides a Log4j2 implementation. To receive jetty logs enable the jetty-slf4j2 module. +[tags] +logging +log4j2 +log4j +slf4j + [depend] slf4j-api log4j2-api diff --git a/jetty-util/src/main/config/modules/slf4j-logback.mod b/jetty-util/src/main/config/modules/slf4j-logback.mod index 0a23efdad13..5e973cbe064 100644 --- a/jetty-util/src/main/config/modules/slf4j-logback.mod +++ b/jetty-util/src/main/config/modules/slf4j-logback.mod @@ -2,6 +2,10 @@ Provides a SLF4J implementation that logs to Logback classic To receive jetty logs enable the jetty-slf4j module. +[tags] +logging +slf4j + [depend] slf4j-api logback-core diff --git a/jetty-util/src/main/config/modules/slf4j-simple.mod b/jetty-util/src/main/config/modules/slf4j-simple.mod index 804cde01a03..9990da282cf 100644 --- a/jetty-util/src/main/config/modules/slf4j-simple.mod +++ b/jetty-util/src/main/config/modules/slf4j-simple.mod @@ -2,6 +2,10 @@ Provides SLF4J simple logging implementation. To receive jetty logs enable the jetty-slf4j module. +[tags] +logging +slf4j + [depend] slf4j-api diff --git a/jetty-util/src/main/config/modules/stderrout-logging.mod b/jetty-util/src/main/config/modules/stderrout-logging.mod index 846f2dabd84..77952ac54f9 100644 --- a/jetty-util/src/main/config/modules/stderrout-logging.mod +++ b/jetty-util/src/main/config/modules/stderrout-logging.mod @@ -2,6 +2,9 @@ Redirects JVMs stderr and stdout to a log file, including output from Jetty's default StdErrLog logging. +[tags] +logging + [xml] etc/stderrout-logging.xml