Gradle 2.0 用户指南翻译——第二十八章. Jetty 插件

翻译项目请关注Github上的地址:
https://github.com/msdx/gradledoc
本文翻译所在分支:
https://github.com/msdx/gradledoc/tree/2.0 。
在线浏览地址:
http://gradledoc.qiniudn.com/2.0/userguide/userguide.html 。
另外,Android 手机用户可通过我写的一个程序浏览文档,带缓存功能的,目前0.6开发中版本兼容 Android 2.3以上系统,项目地址如下:
https://github.com/msdx/gradle-doc-apk
翻译不易,转载请注明本文在CSDN博客上的出处:

https://blog.csdn.net/maosidiaoxian/article/details/84677996

关于我对Gradle的翻译,以Github上的项目及http://gradledoc.qiniudn.com 上的文档为准。如发现翻译有误的地方,将首先在以上两个地方更新。因时间精力问题,博客中发表的译文基本不会同步修改。

第二十八章. Jetty 插件

Chapter 28. The Jetty Plugin

Jetty 插件扩展自 War 插件,并添加了一些任务,这些任务可以让你在构建时部署你的 web 应用程序到一个嵌入的 Jetty web 容器中。 
The Jetty plugin extends the War plugin to add tasks which allow you to deploy your web application to a Jetty web container embedded in the build.

28.1. 用法

28.1. Usage

要使用 Jetty 的插件,请在构建脚本中包含以下内容:
To use the Jetty plugin, include in your build script:

示例 28.1. 使用 Jetty 插件 - Example 28.1. Using the Jetty plugin

build.gradle

apply plugin: 'jetty'

28.2. 任务

28.2. Tasks

Jetty 插件定义了以下任务:
The Jetty plugin defines the following tasks:

表 28.1. Jetty 插件——任务 - Table 28.1. Jetty plugin - tasks

任务名称
Task name
依赖于
Depends on
类型
Type
描述
Description
jettyRuncompileJettyRun启动 Jetty 实例并部署上 exploded web 应用程序。
Starts a Jetty instance and deploys the exploded web application to it.
jettyRunWarwarJettyRunWar启动 Jetty 实例并部署上 WAR 包。
Starts a Jetty instance and deploys the WAR to it.
jettyStop-JettyStop停止 Jetty 实例。
Stops the Jetty instance.

图 28.1. Jetty 插件——任务 - Figure 28.1. Jetty plugin - tasks

Jetty插件——任务

28.3. 项目布局

28.3. Project layout

Jetty 插件使用 和 War 插件相同的布局。
The Jetty plugin uses the same layout as the War plugin.

28.4. 依赖管理

28.4. Dependency management

Jetty 插件不定义任何依赖配置。
The Jetty plugin does not define any dependency configurations.

28.5. 公约属性

28.5. Convention properties

Jetty 插件定义了以下公约属性:
The Jetty plugin defines the following convention properties:

表 28.2. Jetty 插件——属性 - Table 28.2. Jetty plugin - properties

属性名称
Property name
类型
Type
默认值
Default value
描述
Description
contextPathStringWAR 文件的基本名称 
WAR file base name
Jetty 容器中的应用程序部署位置。 
The application deployment location within the Jetty container.
httpPortInteger8080Jetty 应监听的 HTTP 请求的 TCP 端口。 
The TCP port which Jetty should listen for HTTP requests on.
stopPortIntegernullJetty 应监听的管理请求的 TCP 端口。 
The TCP port which Jetty should listen for admin requests on.
stopKeyStringnull当请求 Jetty 停止时,传递给它的 key。 
The key to pass to Jetty when requesting it to stop.

这些属性都由一个 JettyPluginConvention 公约对象提供。
These properties are provided by a JettyPluginConvention convention object.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值