允许微调 Eclipse 插件的 WTP Facet 详细信息。
高级配置闭包 `beforeMerged` 和 `whenMerged` 接收 WtpFacet 对象作为参数。
plugins {
id 'war' // or 'ear' or 'java'
id 'eclipse-wtp'
}
eclipse {
wtp {
facet {
//you can add some extra wtp facets or update existing ones; mandatory keys: 'name', 'version':
facet name: 'someCoolFacet', version: '1.3'
file {
//if you want to mess with the resulting XML in whatever way you fancy
withXml {
def node = it.asNode()
node.appendNode('xml', 'is what I love')
}
//beforeMerged and whenMerged closures are the highest voodoo for the tricky edge cases.
//the type passed to the closures is WtpFacet
//closure executed after wtp facet file content is loaded from existing file
//but before gradle build information is merged
beforeMerged { wtpFacet ->
//tinker with WtpFacet here
}
//closure executed after wtp facet file content is loaded from existing file
//and after gradle build information is merged
whenMerged { wtpFacet ->
//you can tinker with the WtpFacet here
}
}
}
}
}
| 块 | 描述 |
file | 启用高级配置,例如调整输出 XML 或影响现有 WTP Facet 文件内容与 Gradle 构建信息合并的方式。 |
添加一个 Facet。
如果具有给定名称的 Facet 已存在,则其版本将被更新。
如果是“jst.ejb”Facet,它也将作为固定 Facet 添加。
示例请参见 EclipseWtpFacet 的文档
void file(Action<? super XmlFileContentMerger> action)
Action<? super XmlFileContentMerger>启用高级配置,例如调整输出 XML 或影响现有 WTP Facet 文件内容与 Gradle 构建信息合并的方式。
示例请参见 EclipseWtpFacet 的文档
启用高级配置,例如调整输出 XML 或影响现有 WTP Facet 文件内容与 Gradle 构建信息合并的方式。
传递给 `whenMerged{}` 和 `beforeMerged{}` 闭包的对象类型为 WtpFacet
示例请参见 EclipseWtpFacet 的文档
- 委托给
XmlFileContentMerger来自file