Jetty“OPTIONS = All”迁移到Jetty 9模块

时间:2013-12-17 23:39:40

标签: jetty

版本9.1之前的Jetty版本有OPTIONS argument 版本9.1的Jetty版本有module system

什么是Jetty 9.1模块,相当于OPTIONS=All

1 个答案:

答案 0 :(得分:1)

由于您未指定“OPTIONS = All”对您来说意味着什么,因此无法按原样回答。

以下是Jetty 8.1.13.v20130916

的含义
$ java -jar start.jar OPTIONS=All --version
Active Options: [All, Server, annotations, ext, jmx, jsp, plus, resources, websocket]
Version Information on 39 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
      changes to the OPTIONS=[option,option,...] command line option will be reflected here.
 0:                (dir) | ${jetty.home}/resources
 1:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-xml-8.1.13.v20130916.jar
 2:  3.0.0.v201112011016 | ${jetty.home}/lib/servlet-api-3.0.jar
 3:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-http-8.1.13.v20130916.jar
 4:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-continuation-8.1.13.v20130916.jar
 5:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-server-8.1.13.v20130916.jar
 6:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-security-8.1.13.v20130916.jar
 7:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-servlet-8.1.13.v20130916.jar
 8:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-webapp-8.1.13.v20130916.jar
 9:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-deploy-8.1.13.v20130916.jar
10:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-servlets-8.1.13.v20130916.jar
11:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-rewrite-8.1.13.v20130916.jar
12:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-jmx-8.1.13.v20130916.jar
13:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-ajp-8.1.13.v20130916.jar
14:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-jndi-8.1.13.v20130916.jar
15:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-plus-8.1.13.v20130916.jar
16:  1.1.0.v201105071233 | ${jetty.home}/lib/jndi/javax.activation-1.1.0.v201105071233.jar
17:  1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar
18:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-annotations-8.1.13.v20130916.jar
19:  1.1.0.v201108011116 | ${jetty.home}/lib/annotations/javax.annotation-1.1.0.v201108011116.jar
20:  3.1.0.v200803061910 | ${jetty.home}/lib/annotations/org.objectweb.asm-3.1.0.v200803061910.jar
21:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-policy-8.1.13.v20130916.jar
22:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-client-8.1.13.v20130916.jar
23:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-websocket-8.1.13.v20130916.jar
24:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-overlay-deployer-8.1.13.v20130916.jar
25:                1.1.1 | ${jetty.home}/lib/jta/javax.transaction-1.1.1.v201105210645.jar
26:     8.1.13.v20130916 | ${jetty.home}/lib/spdy/spdy-core-8.1.13.v20130916.jar
27:     8.1.13.v20130916 | ${jetty.home}/lib/spdy/spdy-jetty-8.1.13.v20130916.jar
28:     8.1.13.v20130916 | ${jetty.home}/lib/spdy/spdy-jetty-http-8.1.13.v20130916.jar
29:  2.2.0.v201108011116 | ${jetty.home}/lib/jsp/com.sun.el-2.2.0.v201108011116.jar
30:  2.2.0.v201108011116 | ${jetty.home}/lib/jsp/javax.el-2.2.0.v201108011116.jar
31:  1.2.0.v201105211821 | ${jetty.home}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar
32:  2.2.0.v201112011158 | ${jetty.home}/lib/jsp/javax.servlet.jsp-2.2.0.v201112011158.jar
33:  2.2.2.v201112011158 | ${jetty.home}/lib/jsp/org.apache.jasper.glassfish-2.2.2.v201112011158.jar
34:  1.2.0.v201112081803 | ${jetty.home}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar
35: 3.7.0.M20110909-1335 | ${jetty.home}/lib/jsp/org.eclipse.jdt.core-3.7.1.jar
36:     8.1.13.v20130916 | ${jetty.home}/lib/monitor/jetty-monitor-8.1.13.v20130916.jar
37:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-util-8.1.13.v20130916.jar
38:     8.1.13.v20130916 | ${jetty.home}/lib/jetty-io-8.1.13.v20130916.jar

这只是为Jetty的嵌入式start.config中声明的所有其他选项启用了类路径(自Jetty 9.1中删除后的概念)。 OPTIONS=All的使用不允许使用那些需要以正确的顺序(不能少)定义XML声明和属性的类。

使用OPTIONS=All也不代表Jetty附带的所有jar和类。一些Jetty发行版还有jdbc,xa,jta,cdi,jms和cometd,它们不是由OPTIONS=All选取的,而是具有OPTIONS=All,jms之类的特定条目。然后你还有SSL的特定配置,NPN + SPDY不是简单地用简单OPTIONS=All

获取的

使用Jetty 9.1和模块系统,您可以将classpath + xml配置+属性集于一身。启用模块,您将完成剩下的工作。

使用Jetty 9.1,你还拥有比Jetty 8更多的功能,所以说“我想要一切”也无关紧要。但是,如果您说“如果我在start.ini中启用了手动定义的XML条目的所有类路径条目”,那么我想在Jetty 8.1中使用Jetty 9.1中的相同功能集,那么这就是等效的。

${jetty.base}

的形式呈现

${jetty.base}

创建一个空目录
[joakim]$ cd jetty-distribution-9.1.0.v20131115
[jetty-distribution-9.1.0.v20131115]$ mkdir my-base
[jetty-distribution-9.1.0.v20131115]$ cd my-base/

初始化:

这个快速入门步骤将:

  1. 构建适合您的start.ini
  2. 创建模块可能需要的任何目录
  3. 下载您可能需要的任何工件(例如示例密钥库和npn jar)
  4. 这不是必需的步骤,您可以手动完全手动创建/编辑/管理start.ini和基本目录。

    此命令相当于Jetty 8中的大多数相同功能。

    [my-base]$ java -jar ../start.jar --add-to-start=ext,resources,jsp,continuation,rewrite,proxy,monitor,stats,ipaccess,jmx,requestlog,logging,https,http,webapp,annotations,websocket,spdy
    WARNING: ext             initialised in ${jetty.base}/start.ini (appended)
    WARNING: ext             enabled in     ${jetty.base}/start.ini
    MKDIR: ${jetty.base}/lib
    MKDIR: ${jetty.base}/lib/ext
    WARNING: resources       initialised in ${jetty.base}/start.ini (appended)
    WARNING: resources       enabled in     ${jetty.base}/start.ini
    MKDIR: ${jetty.base}/resources
    WARNING: jsp             initialised in ${jetty.base}/start.ini (appended)
    WARNING: jsp             enabled in     ${jetty.base}/start.ini
    WARNING: server          initialised in ${jetty.base}/start.ini (appended)
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: continuation    initialised in ${jetty.base}/start.ini (appended)
    WARNING: continuation    enabled in     ${jetty.base}/start.ini
    WARNING: rewrite         initialised in ${jetty.base}/start.ini (appended)
    WARNING: rewrite         enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: proxy           initialised in ${jetty.base}/start.ini (appended)
    WARNING: proxy           enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: monitor         initialised in ${jetty.base}/start.ini (appended)
    WARNING: monitor         enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: stats           initialised in ${jetty.base}/start.ini (appended)
    WARNING: stats           enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: ipaccess        initialised in ${jetty.base}/start.ini (appended)
    WARNING: ipaccess        enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: jmx             initialised in ${jetty.base}/start.ini (appended)
    WARNING: jmx             enabled in     ${jetty.base}/start.ini
    WARNING: requestlog      initialised in ${jetty.base}/start.ini (appended)
    WARNING: requestlog      enabled in     ${jetty.base}/start.ini
    MKDIR: ${jetty.base}/logs
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: logging         initialised in ${jetty.base}/start.ini (appended)
    WARNING: logging         enabled in     ${jetty.base}/start.ini
    WARNING: https           initialised in ${jetty.base}/start.ini (appended)
    WARNING: https           enabled in     ${jetty.base}/start.ini
    WARNING: ssl             initialised in ${jetty.base}/start.ini (appended)
    WARNING: ssl             enabled in     ${jetty.base}/start.ini
    DOWNLOAD: http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/main/config/etc/keystore to etc/keystore
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: http            initialised in ${jetty.base}/start.ini (appended)
    WARNING: http            enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: webapp          initialised in ${jetty.base}/start.ini (appended)
    WARNING: webapp          enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: annotations     initialised in ${jetty.base}/start.ini (appended)
    WARNING: annotations     enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: websocket       initialised in ${jetty.base}/start.ini (appended)
    WARNING: websocket       enabled in     ${jetty.base}/start.ini
    WARNING: annotations     enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: spdy            initialised in ${jetty.base}/start.ini (appended)
    WARNING: spdy            enabled in     ${jetty.base}/start.ini
    WARNING: ssl             enabled in     ${jetty.base}/start.ini
    WARNING: server          enabled in     ${jetty.base}/start.ini
    WARNING: npn             initialised in ${jetty.base}/start.ini (appended)
    WARNING: npn             enabled in     ${jetty.base}/start.ini
    DOWNLOAD: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar to lib/npn/npn-boot-1.1.6.v20130911.jar
    

    您可以通过查看start.ini或只是向Jetty询问--list-config

    来查看此配置的外观
    [my-base]$ java -jar ../start.jar --list-config
    
    Java Environment:
    -----------------
     java.home=/opt/java/jdk-7u45-x64/jre
     java.vm.vendor=Oracle Corporation
     java.vm.version=24.45-b08
     java.vm.name=Java HotSpot(TM) 64-Bit Server VM
     java.vm.info=mixed mode
     java.runtime.name=Java(TM) SE Runtime Environment
     java.runtime.version=1.7.0_45-b18
     java.io.tmpdir=/tmp
    
    
    Jetty Environment:
    -----------------
     jetty.home=/home/joakim/jetty-distribution-9.1.0.v20131115
     jetty.base=/home/joakim/jetty-distribution-9.1.0.v20131115/my-base
     jetty.version=9.1.0.v20131115
    
    JVM Arguments:
    --------------
     -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
    
    System Properties:
    ------------------
     jetty.base = /home/joakim/jetty-distribution-9.1.0.v20131115/my-base
     jetty.home = /home/joakim/jetty-distribution-9.1.0.v20131115
    
    Properties:
    -----------
     http.timeout = 30000
     https.port = 8443
     https.timeout = 30000
     jetty.dump.start = false
     jetty.dump.stop = false
     jetty.keymanager.password = OBF:1u2u1wml1z7s1z7a1wnl1u2g
     jetty.keystore = etc/keystore
     jetty.keystore.password = OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4
     jetty.port = 8080
     jetty.secure.port = 8443
     jetty.truststore = etc/keystore
     jetty.truststore.password = OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4
     spdy.port = 8443
     spdy.timeout = 30000
     threads.max = 200
     threads.min = 10
     threads.timeout = 60000
    
    Jetty Server Classpath:
    -----------------------
    Version Information on 45 entries in the classpath.
    Note: order presented here is how they would appear on the classpath.
          changes to the --module=name command line options will be reflected here.
     0:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-client-9.1.0.v20131115.jar
     1:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-continuation-9.1.0.v20131115.jar
     2:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-jmx-9.1.0.v20131115.jar
     3:                    (dir) | ${jetty.base}/resources
     4:                    3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
     5:                  3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
     6:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-http-9.1.0.v20131115.jar
     7:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-server-9.1.0.v20131115.jar
     8:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-xml-9.1.0.v20131115.jar
     9:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-util-9.1.0.v20131115.jar
    10:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-io-9.1.0.v20131115.jar
    11:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-jndi-9.1.0.v20131115.jar
    12:      1.1.0.v201105071233 | ${jetty.home}/lib/jndi/javax.activation-1.1.0.v201105071233.jar
    13:      1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar
    14:                      1.2 | ${jetty.home}/lib/jndi/javax.transaction-api-1.2.jar
    15:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-rewrite-9.1.0.v20131115.jar
    16:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-security-9.1.0.v20131115.jar
    17:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-servlet-9.1.0.v20131115.jar
    18:                    3.0.0 | ${jetty.home}/lib/jsp/javax.el-3.0.0.jar
    19:      1.2.0.v201105211821 | ${jetty.home}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar
    20:                    2.3.2 | ${jetty.home}/lib/jsp/javax.servlet.jsp-2.3.2.jar
    21:                    2.3.1 | ${jetty.home}/lib/jsp/javax.servlet.jsp-api-2.3.1.jar
    22:                    2.3.3 | ${jetty.home}/lib/jsp/jetty-jsp-jdt-2.3.3.jar
    23:      1.2.0.v201112081803 | ${jetty.home}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar
    24:   3.8.2.v20130121-145325 | ${jetty.home}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar
    25:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-plus-9.1.0.v20131115.jar
    26:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-proxy-9.1.0.v20131115.jar
    27:          9.1.0.v20131115 | ${jetty.home}/lib/spdy/spdy-client-9.1.0.v20131115.jar
    28:          9.1.0.v20131115 | ${jetty.home}/lib/spdy/spdy-core-9.1.0.v20131115.jar
    29:          9.1.0.v20131115 | ${jetty.home}/lib/spdy/spdy-http-common-9.1.0.v20131115.jar
    30:          9.1.0.v20131115 | ${jetty.home}/lib/spdy/spdy-http-server-9.1.0.v20131115.jar
    31:          9.1.0.v20131115 | ${jetty.home}/lib/spdy/spdy-server-9.1.0.v20131115.jar
    32:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-webapp-9.1.0.v20131115.jar
    33:          9.1.0.v20131115 | ${jetty.home}/lib/jetty-annotations-9.1.0.v20131115.jar
    34:                      4.1 | ${jetty.home}/lib/annotations/asm-4.1.jar
    35:                      4.1 | ${jetty.home}/lib/annotations/asm-commons-4.1.jar
    36:                      1.2 | ${jetty.home}/lib/annotations/javax.annotation-api-1.2.jar
    37:                      1.0 | ${jetty.home}/lib/websocket/javax.websocket-api-1.0.jar
    38:          9.1.0.v20131115 | ${jetty.home}/lib/websocket/javax-websocket-client-impl-9.1.0.v20131115.jar
    39:          9.1.0.v20131115 | ${jetty.home}/lib/websocket/javax-websocket-server-impl-9.1.0.v20131115.jar
    40:          9.1.0.v20131115 | ${jetty.home}/lib/websocket/websocket-api-9.1.0.v20131115.jar
    41:          9.1.0.v20131115 | ${jetty.home}/lib/websocket/websocket-client-9.1.0.v20131115.jar
    42:          9.1.0.v20131115 | ${jetty.home}/lib/websocket/websocket-common-9.1.0.v20131115.jar
    43:          9.1.0.v20131115 | ${jetty.home}/lib/websocket/websocket-server-9.1.0.v20131115.jar
    44:          9.1.0.v20131115 | ${jetty.home}/lib/websocket/websocket-servlet-9.1.0.v20131115.jar
    
    Jetty Active XMLs:
    ------------------
     ${jetty.home}/etc/jetty-jmx.xml
     ${jetty.home}/etc/jetty-logging.xml
     ${jetty.home}/etc/jetty.xml
     ${jetty.home}/etc/jetty-http.xml
     ${jetty.home}/etc/jetty-ipaccess.xml
     ${jetty.home}/etc/jetty-monitor.xml
     ${jetty.home}/etc/jetty-requestlog.xml
     ${jetty.home}/etc/jetty-rewrite.xml
     ${jetty.home}/etc/jetty-ssl.xml
     ${jetty.home}/etc/jetty-stats.xml
     ${jetty.home}/etc/jetty-https.xml
     ${jetty.home}/etc/jetty-plus.xml
     ${jetty.home}/etc/jetty-proxy.xml
     ${jetty.home}/etc/jetty-spdy.xml
     ${jetty.home}/etc/jetty-annotations.xml