jetty.start.config中英文对照

本文详细解析Jetty启动配置文件的格式与语法,包括条件判断、路径处理等关键信息,并展示了如何通过配置加载各类模块。

声明:英语水平不好,错误或者不通顺地方请留言指出,或发邮件loowj@qq.com

欢迎大家一起努力。


# This file controls what file are to be put on classpath or command line.

# //这个文件是控制那些文件被加载与命令行配置

# Format is as follows:

# //格式如下:

#

# Each line contains entry in the format:

# //每一行包含条目的格式

配置文件以行为单位,每一行的结构如下:

# SUBJECT [ [!] CONDITION [AND|OR] ]*

#

# where SUBJECT:

# ends with ".class" is the Main class to run.

# //如果以".class" 结尾,则它是一个Main类运行入口

# ends with ".xml" is a configuration file for the command line

# //如果以".xml"结尾,则表示是一个配置文件,将会被包含到命令行

# ends with "/" is a directory from which to add all jar and zip files.

# //如果以"/"结尾,则表示是一个目录,且目录下面的所有jar和zip文件都会纳入到类路径中

# ends with "/*" is a directory from which to add all unconsidered jar and zip files.

# //如果以"/*"结尾,会将这一个目录下所有不管重要与否的jar和zip文件应用

# ends with "/**" is a directory from which to recursively add all unconsidered jar and zip files.

# //如果以"/**"结尾,则表示subject是一个目录,该目录下的jar和zip文件会纳入到类路径。如果该目录下面还有子目录,那

# //么也将子目录下的jar/zip文件也纳入到类路径中(依次递归)

# Containing = are used to assign system properties.

# //如果包含 = 号,则该语句是用于增加系统属性的(可以通过System.getProperty获取这里指定的属性)

# Containing ~= are used to assign start properties.

# //如果包含 ~= 号,则用于指定一个启动属性,即一个命令行属性。

# Containing /= are used to assign a canonical path.

# //如果包含 /= 号,则表示指定一个标准的路径。如果你使用相对路径,则会被转化为绝对路径

# all other subjects are treated as files to be added to the classpath.

# //如果SUBJECT不符合以上的内容,则它将会作为一个文件加入到类路径中!

#

# ${name} is expanded to a start property

# //${name} 获取启动属性(在命令行中指定的属性)

# $(name) is expanded to either a start property or a system property.

# //获取系统属性

# The start property ${version} is defined as the version of the start.jar

# //注:${version}是一个内置的属性,指Jetty的版本,该值在start.jar中的类中固化了。可以直接使用!

#

# Files starting with "/" are considered absolute, all others are relative to

# the home directory.

# //使用"/"开头的文件会被认为是绝对路径的,其它则当作主目录为Jetty的相对目录

#

# CONDITION is one of:

# //条件说明

# always

#//表示true

# never

#//检测后面的class是否存在

# available classname # true if class on classpath

# //如果classname指定的类可以在当前的类路径中找到,则返回true

# property name # true if set as start property

# //property name 如果启动属性name被设置,则返回true

# system name # true if set as system property

# //system name 如果系统属性name被设置,则返回true

# exists file # true if file/dir exists

# //如果file文件存在,则返回true

# java OPERATOR version # java version compared to literal

# //java虚拟机版本

# nargs OPERATOR number # number of command line args compared to literal

# //nargs表示用于命令行

# //命令行参数的数目比较

# OPERATOR := one of "<",">","<=",">=","==","!="

# //运算符"<",">","<=",">=","==","!="之一

#

# CONTITIONS can be combined with AND OR or !, with AND being the assume

# operator for a list of CONDITIONS.

# //在使用时,可以将多个CONDITION使用 AND, OR 组合成一个CONDITION。

#

# Classpath operations are evaluated on the fly, so once a class or jar is

# added to the classpath, subsequent available conditions will see that class.

#//另外,上面提到的类路径操作都是立即执行——也就是说,如果在某一行中将A.class加入到类路径中,那该行以后其它命令

#//都可以在类路径中找到A.class,而不是非要等到配置文件处理完后才能找到A.class.(jar包添加立即执行)

# The configuration file may be divided into sections with option names like:

#//配置文件可以通过使用以下方式划分成不同的块。

# [ssl,default]

#

# Clauses after a section header will only be included if they match one of the tags in the

# options property. By default options are set to "default,*" or the OPTIONS property may

# be used to pass in a list of tags, eg. :

#//在该块之后,新块之前的语句都将只对指定的选项OPTIONS生效。用户可以在命令行指定OPTIONS,如下:

#//这里顺便说一下,OPTIONS就是一个启动属性!如果用户没有使用OPTIONS参数,那么该参数默认为"default,*"。如果

#//用户执行上面的命令,那么配置文件中[ssl,default]块下面的语句就会被执行,因为选项中ssl项

# java -jar start.jar OPTIONS=jetty,jsp,ssl

#

# The tag '*' is always appended to the options, so any section with the * tag is always

# applied.

#-----------------------------------------------------------------------------------------------------------------------------

# add a property defined classpath

#//添加一个属性定义类路径

${path}.path property path

# add a property defined library directory

# //添加一个定义目录的属性

${lib}/** exists ${lib}

#exists ${lib} 验证这个目录是否存在,存在返回true

# Try different settings of jetty.home until the start.jar is found.

jetty.home=. ! exists $(jetty.home)/start.jar

jetty.home=.. ! exists $(jetty.home)/start.jar

jetty.home=jetty-distribution/src/main/resources ! exists $(jetty.home)/start.jar

jetty.home=../jetty-distribution/src/main/resources ! exists $(jetty.home)/start.jar

jetty.home=. ! exists $(jetty.home)/start.jar

jetty.home/=$(jetty.home) exists $(jetty.home)/start.jar

# The main class to run

org.eclipse.jetty.xml.XmlConfiguration.class

${start.class}.class property start.class

# The default configuration files

$(jetty.home)/etc/jetty.xml nargs == 0

./jetty-server/src/main/config/etc/jetty.xml nargs == 0 AND ! exists $(jetty.home)/etc/jetty.xml

# Default OPTIONS if not specified on the command line

OPTIONS~=default,* ! property OPTIONS

# Add a resources directory if it is there

[All,resources,default]

$(jetty.home)/resources/

# Add jetty modules

[*]

$(jetty.home)/lib/jetty-util-$(version).jar ! available org.eclipse.jetty.util.StringUtil

$(jetty.home)/lib/jetty-io-$(version).jar ! available org.eclipse.jetty.io.Buffer

[Server,All,xml,default]

$(jetty.home)/lib/jetty-xml-$(version).jar ! available org.eclipse.jetty.xml.XmlParser

[Server,All,server,default]

$(jetty.home)/lib/servlet-api-2.5.jar ! available javax.servlet.ServletContext

$(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser

$(jetty.home)/lib/jetty-continuation-$(version).jar ! available org.eclipse.jetty.continuation.Continuation

$(jetty.home)/lib/jetty-server-$(version).jar ! available org.eclipse.jetty.server.Server

[Server,All,security,default]

$(jetty.home)/lib/jetty-security-$(version).jar ! available org.eclipse.jetty.security.LoginService

[Server,All,servlet,default]

$(jetty.home)/lib/servlet-api-2.5.jar ! available javax.servlet.ServletContext

$(jetty.home)/lib/jetty-servlet-$(version).jar ! available org.eclipse.jetty.servlet.ServletHandler

[Server,All,webapp,default]

$(jetty.home)/lib/jetty-webapp-$(version).jar ! available org.eclipse.jetty.webapp.WebAppContext

[Server,All,deploy,default]

$(jetty.home)/lib/jetty-deploy-$(version).jar ! available org.eclipse.jetty.deploy.ContextDeployer

[Server,All,servlets,default]

$(jetty.home)/lib/jetty-servlets-$(version).jar ! available org.eclipse.jetty.servlets.WelcomeFilter

[All,rewrite]

$(jetty.home)/lib/jetty-rewrite-$(version).jar ! available org.eclipse.jetty.rewrite.handler.RewriteHandler

[All,jmx]

$(jetty.home)/lib/jetty-jmx-$(version).jar ! available org.eclipse.jetty.jmx.MBeanContainer

[All,ajp]

$(jetty.home)/lib/jetty-ajp-$(version).jar ! available org.eclipse.jetty.ajp.Ajp13Connection

[All,plus,jndi]

$(jetty.home)/lib/jetty-jndi-${version}.jar ! available org.eclipse.jetty.jndi.ContextFactory

$(jetty.home)/lib/jetty-plus-${version}.jar ! available org.eclipse.jetty.plus.jndi.NamingEntry

$(jetty.home)/lib/jndi/** exists $(jetty.home)/lib/jndi

[All,annotations]

$(jetty.home)/lib/jetty-annotations-$(version).jar ! available org.eclipse.jetty.annotations.AnnotationFinder

$(jetty.home)/lib/annotations/** exists $(jetty.home)/lib/jndi

[All,setuid]

$(jetty.home)/lib/jetty-setuid-$(version).jar ! available org.eclipse.jetty.setuid.SetUID

$(jetty.home)/lib/setuid/**

[All,policy]

$(jetty.home)/lib/jetty-policy-$(version).jar ! available org.eclipse.jetty.policy.JettyPolicy

$(jetty.home)/lib/policy/jetty.policy

[All,Client,client]

$(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser

$(jetty.home)/lib/jetty-client-$(version).jar ! available org.eclipse.jetty.client.HttpClient

[Client]

$(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser

[All,websocket]

$(jetty.home)/lib/jetty-websocket-$(version).jar ! available org.eclipse.jetty.websocket.WebSocket

# Add ext if it exists

[Server,All,default,ext]

$(jetty.home)/lib/ext/**

# Add all other sub-directories in /lib/ as options in a dynamic way

#//添加在lib/下面的所有文件,/**将递归所有文件夹

[All,=$(jetty.home)/lib/**]

2025-09-04 10:06:04.106:INFO:oejr.Runner:main: Runner 2025-09-04 10:06:04.188:INFO:oejs.Server:main: jetty-9.0.7.v20131107 Connected to the target VM, address: '127.0.0.1:61844', transport: 'socket' 2025-09-04 10:06:04.588:WARN:oejuc.AbstractLifeCycle:main: FAILED o.e.j.w.WebAppContext@43bd7{/pwms,file:/D:/hand/WorkSpace/pwms/context/,STARTING}{file:/D:/hand/WorkSpace/pwms/context/}: java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:1007) at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:990) at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:949) at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:906) at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:879) at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:857) at org.eclipse.jetty.annotations.AnnotationConfiguration.parseContainerPath(AnnotationConfiguration.java:429) at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:192) at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:464) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1317) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:732) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:490) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60) at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:155) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118) at org.eclipse.jetty.server.Server.start(Server.java:342) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60) at org.eclipse.jetty.server.Server.doStart(Server.java:290) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.runner.Runner.run(Runner.java:519) at org.eclipse.jetty.runner.Runner.main(Runner.java:567) 2025-09-04 10:06:04.589:WARN:oejuc.AbstractLifeCycle:main: FAILED org.eclipse.jetty.server.handler.ContextHandlerCollection@1380a71: java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:1007) at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:990) at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:949) at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:906) at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:879) at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:857) at org.eclipse.jetty.annotations.AnnotationConfiguration.parseContainerPath(AnnotationConfiguration.java:429) at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:192) at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:464) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1317) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:732) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:490) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60) at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:155) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118) at org.eclipse.jetty.server.Server.start(Server.java:342) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60) at org.eclipse.jetty.server.Server.doStart(Server.java:290) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69) at org.eclipse.jetty.runner.Runner.run(Runner.java:519) at org.eclipse.jetty.runner.Runner.main(Runner.java:567) 什么原因
09-05
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值